fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 991 forks source link

Notification is not coming when application is in background or killed in android. #625

Open rakeshbaral92 opened 4 years ago

rakeshbaral92 commented 4 years ago

Unable to get the notification when app is in background or killed.

eshope-repo commented 4 years ago

I have the same problem, any idea ?

rakeshbaral92 commented 4 years ago

I have the same problem, any idea ?

Send your notification and data as per the desired format mentioned in document. Check if have missed any data while sending push notification.

{ "notification":{ "title":"Notification title", "body":"Notification body", "sound":"default", "click_action":"FCM_PLUGIN_ACTIVITY", "icon":"fcm_push_icon" }, "data":{ "param1":"value1", "param2":"value2" }, "to":"/topics/topicExample", "priority":"high", "restricted_package_name":"" }

Use all the above code.

eshope-repo commented 4 years ago

Thank you, actually my problem was only when the app was killed. I found an article about several mobile concerned by this problem (Huawei & Xiaomi) which doesn't receive any notification until you don't whitelist you app in the battery manager ... strange but soled my issue

rakeshbaral92 commented 4 years ago

Yeah, thats right. Due to doze mode of new android OS some devices get idle while there is no activity performed. You should white list your application from auto start manager in Xiomi like phones. Happy coding.

On Wed, Nov 20, 2019 at 3:09 PM eshope-repo notifications@github.com wrote:

Thank you, actually my problem was only when the app was killed. I found an article about several mobile concerned by this problem (Huawei & Xiaomi) which doesn't receive any notification until you don't whitelist you app in the battery manager ... strange but soled my issue

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fechanique/cordova-plugin-fcm/issues/625?email_source=notifications&email_token=AHH6MNFCPJYA5JL2CMDTPETQUUAURA5CNFSM4JLRUX7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEERLJSA#issuecomment-555922632, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHH6MNB66TQYA4WFDXAKSNLQUUAURANCNFSM4JLRUX7A .

--

Thanks & Regards

Rakesh Kumar Baral (Android Developer)

[image: Inline image 5] Nexus Technoware Solution Pvt.Ltd (Microsoft Certified & STPI Registered Company) (CIN : U72200OR2007PTC009685)

Plot No: 1692/4371, Nalini Nilaya,Green Park, Kalarahanga, Near Kripalu Residency, Patia, Bhubaneswar-751024, India Contact No- +91-9778209633, +91-8260003333 http://www.ntspl.co.in & http://www.ntsplhostin http://www.ntsplhosting.com/g.com https://www.ntsplhosting.com/security/ssl-certificate/

https://www.ntsplhosting.com/security/ssl-certificate/

https://www.ntsplhosting.com/security/ssl-certificate/ https://www.ntsplhosting.com/security/ssl-certificate/