-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Can't initialize OneSignal on iPhone #1568
Comments
A little followup question. We have now been using OneSignal in production for few weeks and are receiving more and more complaints about users not getting any push notifications. Those users usually don't have any OneSignal subscription because of this bug so they understandable can't receive any notifications. Many of those users do have Icelandic as their preferred language so its clear that this is not a one-off issue. @nan-li Have you or anyone at your teem had the chance to look into this? My guess is that this issue is not isolated to Icelandic and could be affecting many users |
Please update to react-native-onesignal 5.0.2 https://github.com/OneSignal/react-native-onesignal/releases Then follow this guide to share a log from the device, you can share as a .txt file here or with [email protected]: https://documentation.onesignal.com/docs/capturing-a-debug-log You should see the language default to English for any languages we don't support. For notifications not shown, see this guide: https://documentation.onesignal.com/docs/notifications-show-successful-but-are-not-being-shown If you need further assistance, contact [email protected] and our team can help directly. |
This issue probably belongs in the iOS SDK repo, but here are the logs;
Note:
As you can see, the server is returning a The error is logged here: https://github.com/OneSignal/OneSignal-iOS-SDK/blob/major_release_5.0.0/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSUserRequests.swift#L331 I cannot see how it defaults to english. Calling the
This (logs from after the app was restarted
) Running the following code in this state results in; const subId = OneSignal.User.pushSubscription.getPushSubscriptionId();
const token = OneSignal.User.pushSubscription.getPushSubscriptionToken();
console.log(subId, token); // undefined, SOME_VALID_TOKEN Steps to reproduce
IMO I see two issues here;
This is with version package.json; {
"name": "one_signal_example",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web --dev-client",
"test": "jest --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^13.0.0",
"@react-navigation/native": "^6.0.2",
"expo": "~49.0.15",
"expo-build-properties": "~0.8.3",
"expo-dev-client": "~2.4.11",
"expo-font": "~11.4.0",
"expo-linking": "~5.0.2",
"expo-router": "^2.0.0",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
"expo-system-ui": "~2.4.0",
"expo-web-browser": "~12.3.2",
"onesignal-expo-plugin": "^2.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.6",
"react-native-gesture-handler": "~2.12.0",
"react-native-onesignal": "^5.0.2",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-web": "~0.19.6"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "~18.2.14",
"jest": "^29.2.1",
"jest-expo": "~49.0.0",
"react-test-renderer": "18.2.0",
"typescript": "^5.1.3"
},
"overrides": {
"react-refresh": "~0.14.0"
},
"resolutions": {
"react-refresh": "~0.14.0"
},
"private": true
} Created an issue on the iOS SDK; OneSignal/OneSignal-iOS-SDK#1329 |
Hi @Bjarkinn and @magtastic, we have updated our server to accept more language codes including Icelandic. You should be able to initialize with that language now. In addition, any app installations on iOS that were previously failing due to unsupported language should now recover and succeed. And you are both right, it is not isolated to a single language and we are working on a better recovery option when this failure occurs. |
There is the same problem with language sl in Web SDK. Can you fix it please? |
Can you please add also Slovenian (sl) and also other languages? |
What happened?
If the language on an iPhone 14 is set to
Icelandic
and the following code is run we get the error shown in the first image and no push subscription is created on the OneSignal dashboardIf the preferred language is then changed from Icelandic to English and the app reinstalled, OneSignal intialized correctly and a push subscription is created on the OneSignal dashboard
Steps to reproduce?
What did you expect to happen?
I expect OneSignal to initialize no matter what language the phone is set to. Should fallback to some default language if given language can't be supported
React Native OneSignal SDK version
5.0.0
Which platform(s) are affected?
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: