Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

push notification not receive if app killed on android #238

Closed ikkifujiwara closed 7 years ago

ikkifujiwara commented 7 years ago

i have devices like huawei p9 plus, oppo find 7, xiaomi redmi 3s. none of these phones receive any push notification if the app hasn't started before or app killed (not exit app using ionic.platform.exitApp())

i know this issue has raised in #60 but there are no solution in the thread. any idea what can we do for android? maybe manual customizing AndroidManifest.xml

im using ionic 1.3.2, pushwoosh-cordova-plugin 6.4.0, cordova android 6.0.0

thanks.

ikkifujiwara commented 7 years ago

i just got to know that there are service which able to do that

http://www.concretepage.com/android/android-alarm-clock-tutorial-to-schedule-and-cancel-alarmmanager-pendingintent-and-wakefulbroadcastreceiver-example

https://developer.android.com/reference/android/support/v4/content/WakefulBroadcastReceiver.html

any idea how to implement this??

DimanAM commented 7 years ago

Are you sure your application is not getting force stopped? There is usually something like

I/ActivityManager(23856): Force stopping your.package.name ...

in the device logs in this case.

com.google.android.gms.gcm.GcmReceiver is already implemented using WakefulBroadcastReceiver. But if the application is force stopped GcmReceiver won't be able to receive any intents at all until the application is manually started by user.