-
Notifications
You must be signed in to change notification settings - Fork 374
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
RN 0.43 - OneSignal RN 3.2.1 - iOS - Cold start doesn't trigger 'opened' event #509
Comments
@kinnarshah08 it’s very difficult to troubleshoot a crash without the actual error message/stacktrace, can you please post it? Also, are you sure you’re using 3.1.2 or 3.2.1? |
I don't know about 3.1.2 but its definitely the case with 3.2.1. |
@hhunaid This bug would definitely occur if you comment out the first null The registration issues you're facing would be a separate problem - commenting out the first init call is not a good solution. We'll want to troubleshoot more - I'll ask you for more details in the other git issue |
Hi @Nightsd01 , My bad - it was 3.2.1. Thanks for pointing it out - Have updated the bug report. I cannot attach a stack trace or message as this fails without raising an exception - the event handler itself never gets called on the initial notification. A weird behavior (which I jokingly call the quantum particle behavior) is that the system works as soon as you try to "observe" it by debugging in any way:
In a nutshell, whenever you try observing the notification in any way, it starts working - my hypothesis is that the app waits for the bundle to load when in debug mode but I can be wrong. I am also adding a snippet of
Also, with reference to your comment directed at @hhunaid, do we need a null init call before we pass on the key? Would it be something like: I really appreciate you guys helping out on this. |
@kinnarshah08 the SDK automatically calls init, long before the React-Native runtime is loaded (before it knows your app ID). There’s no need for you to call it again. Thanks for all of the info, it’s quite helpful |
@kinnarshah08 Would you be able to use something like Crashlytics so we can get a stack trace from Schrodinger's bug? Most iOS apps are configured to enable certain compiler optimizations when in release mode. This optimizations cause the compilation progress to take longer, so it's usually only enabled for Release builds. The fact that it still works even in release mode when debugging is enabled indicates it's probably a timing issue/race condition. A stack trace would be extremely helpful in this case, so please use something like Crashlytics so we can debug it |
We suspect this issue is being caused by a race condition that we fixed today (#512 ). We expect to have a new update within the next few hours to fix this and other related issues |
The new update (3.2.3) has been released and should fix this issue. @kinnarshah08 Please feel free to let me know if you see this issue (or other issues) again and I'll be happy to investigate. |
Hi @Nightsd01, I can confirm that this update resolves the issue.
|
Hi Guys, I am still having an issue where the onOpened function is not triggered when the app is closed, when the app closes again and reopened for the second time, it is triggered. |
Description:
Hello,
Sharing a problem that I have been facing for a while now. Notification behaviour is different for cold start and a background app in iOS.
Things work as planned if the app is in background or if the debug mode is on. For release mode in iOS, the app opens up but the notification doesn't fire up.
Sharing snippets of index.ios.js and Main.js
index.ios.js
Main.js
Environment
RN 0.43
OneSignal RN 3.2.1
iOS
NO Redux
Additional Info
I followed other seemingly related issues and moved the listeners to:
Both led to app crashing on launch.
I also tried to tap into
PushNotificationIOS.getInitialNotification()
- No data received.Any help around this is very much appreciated.
The text was updated successfully, but these errors were encountered: