App not start properly when open from notifications (iOS device)
I have a weird problem, that occurs on my iPhone device.
I set the
import OneSignal from 'react-native-onesignal';
in my App.js which is imported and registered in my index.ios.js file.
When I open the app, it starts and everything works well. But, after I close the app (like force exit) and I send a notification with OneSignal, it is received well, then I tap on it and the app opens up, but it freezes. This happens only when I build the app in release mode (when the app is build in debug mode, and the debugger is opened, it is working good).
When I remove the mentioned import from the App.js, and try running the app from a notification in same way, it opens up and runs well. (So the problem occurs only, when I import the react-native-onesignal to my code, and only on release mode).
What the problem can be?
I am using RN 0.35 react-native-onesignal 3.0.2 Using Pods
@kuby Could you add which version of the iOS native SDK you used with your project? It will be in the Podfile.lock in your project.
Also please let us know if the same things happens with a simple body only notification. Without any action buttons or attachments.
Lastly let us know if this happens with iOS 10 or older iOS 9 devices.
Thanks for your response.
My Podfile.lock contains this:
PODS:
- OneSignal (2.4.2)
DEPENDENCIES:
- OneSignal
SPEC CHECKSUMS: OneSignal: a94d1ca53d05c29de4f4b150bad8ff9c4cc34f67
PODFILE CHECKSUM: a1de7945c56f36677852a100a18d1ec19b91adcb
COCOAPODS: 1.2.0
There are no action buttons nor any attachments when I am creating my notification. I just simple create new message in OneSignal dashboard, fill the first three rows with some text, and push it as it is.
I am testing this with an iPhone6, with iOS 10
So just to be more specific what is happening:
The app starts, it shows the LaunchImage, after that it shows my basic layout, but my content is generated from the data sent by server and my app appears like its offline (doesn't have an internet connection) however my handler for the offline connection does not triggering, so actually I cannot do anything with my app (just for info, I cannot open my drawer menu also, which is from the package react-native-router-flux so maybe its not just the internet connection problem).
But the app is not totally freezed, I have a scrollable listview after my header, and I can actually scroll in it (it moves when I drag it).
Can this be a something with the POD files you mentioned? How can I get some logs, or crash reports which actually shows some usefull informations? I tried to log the device logs, but nothings there about the app.
Guys, I figured it out, finally!
The whole time it was my mistake I made in my NetInfo event listeners. My app launches based on the network connection, so I have an event listener for that, on app re-open there was not a network change, so the listener was not listened. I had to check the network connection first, and then attache the listeners.
Thank you for help, I am closing the issue.