phonegap / phonegap-plugin-push

Register and receive push notifications
MIT License
1.94k stars 1.91k forks source link

Android 8 (oreo) not receive notification after ~5 minute in Background #2777

Open sangle1096 opened 5 years ago

sangle1096 commented 5 years ago

Steps to Reproduce

This version of plugin using FCM and working fine at all device but with Android 8 the notification still receive the notification after until 5 minute . not thing notification be receive although i sent many time

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android > 8

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Oppo

Cordova CLI version and cordova platform version

cordova --version                                    # e.g. 7.1.0
cordova platform version android                     # e.g. 6.2.3

Plugin version

cordova plugin version | grep phonegap-plugin-push   2.0.0

Sample Code that illustrates the problem


                forceShow   : true,
                icon        : "ic_notification",
                image       : "icon",
                senderID    : appParams.SENDER_ID,
                clearBadge            : true,
                clearNotifications    : false
RomuloRPS commented 5 years ago

I had a similar issue with android 8 too, after some workaround I found this code that worked for me:

PushNotification.createChannel(() => {},() => {}, { id: 'channel1', description: 'notification', importance: 5, vibration: true, sound : 'notification' });

sangle1096 commented 5 years ago

Hi @RomuloRPS thank you for your answer. I founding out it because the Power manager of Asus is turn off my App background (LOL) . I not try your code yet .. but i think it'll be fix this issue.