Open melwinVincent opened 5 years ago
@macdonst : Hi Simon , Please expedite. Our production release is on hold because of this issue and it's getting hard to convince the client. Please help.
Thanks and regards, Melwin Vincent
Not sure what you expect, but if a phone setting affects the push notifications there is nothing we can do about it.
@jcesarmobile : Yes you are absolutely right. I need to check this in other manufacturers phones and lets see if the same issue exists.
@melwinVincent I think the root cause of this issue is that the One Plus 3T battery optimization kills the service that receives the push notifications for your app when it's not running. I don't think there is anything I can do to fix this short of saying don't turn on the Optimize function for the app.
Have you tried running your app on a non-One Plus 3T device? I have a feeling it would work as intended on most phones. However, please read: https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md#chinese-android-phones
@macdonst : Hi Simon. Thank you for your support. Everything works as expected in Samsung and Huawei devices with android 8. This issue is something specific with one plus phones.
Expected Behaviour
Need to receive push notifications when app is running , when is app is in foreground and also when app is cleared from foreground (clearing from the list of running apps)
Actual Behaviour
I'm receiving notifications when app is running and when app is in foreground. But not receiving when app is cleared from the list of foreground running apps. But everything works as expected when I go to the settings->Battery Optimization and choose the option "Don't Optimize". Then I start getting push notifications even when the app is not in the foreground apps list. And if I choose again to 'Optimize' the app, then surprisingly it works in the background as expected.
Reproduce Scenario (including but not limited to)
Screenshot of Don't Optimize in Settings![image](https://user-images.githubusercontent.com/12426903/48215210-32695500-e39b-11e8-9095-ddc930f56229.png)
Steps to Reproduce
Just create a sample ionic (version-1) mobile app
ionic start myproject ionic platform add android@6.3.0 or ionic platform add android@latest cordova plugin add phonegap-plugin-push@2.1.2
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
Android 8
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
I'm using OnePlus 3T
Cordova CLI version and cordova platform version
Tested with both versions of android -> "cordova-android": "^7.1.2" and "cordova-android": "^6.3.0", Cordova version is -> 7.1.0
Plugin version
phonegap-plugin-push version ->
Sample Push Data Payload
Sample Code that illustrates the problem