问题
I've added oneSignal
library to my android project. Everything goes right except when i click on the received notification from one signal server. it takes about one or two minute to open my android app on my device, but emulator works fine.
My device is Galaxy s7 with android 8 and emulator uses android 5. I guess my android version is the issue. maybe new features on android 8 does not allow app to open immediately. Any idea?
回答1:
Finally, after a lot of searching, I found the cause. According to this article,
Several manufacturers like Sony, Asus and Samsung offer battery saver modes to extract maximum performance from the battery in their devices.
The battery saver apps put our Android apps to sleep. So, you should put your app in the UNMONITORED APPS list in android settings. In Samsung devices, the root is Settings/ Device Maintenance/ Battery/ Unmonitored apps.
Also killing the app may result in the delay of launching the app. So I recommend to not kill the app from back stack memory.
But these recommendations are for client side. And I think this is another problem!!!
来源:https://stackoverflow.com/questions/51579758/opening-android-application-has-delay-after-clicking-on-onesignal-notification-i