phonegap / phonegap-plugin-push

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

not able to send notification from FCM console to Android 8.0.0 #2444

Open mathewk2017 opened 6 years ago

mathewk2017 commented 6 years ago

Expected Behaviour

when a message sends from fcm console device should receive the notification.

Actual Behaviour

Notifications received in 4.4,7,6 android versions, not in oreo(8.0).

Reproduce Scenario (including but not limited to)

install the push plugin and add android platform

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

Android 8.0.0

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

Andoird 8.0.0 Honor View10

Cordova CLI version and cordova platform version

cli packages: (node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.10
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

ios-deploy : 1.9.2
ios-sim    : 6.0.0
Node       : v6.11.2
npm        : 3.10.10
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b

Environment Variables:

ANDROID_HOME : /Applications/ADT/sdk

Misc:

backend : pro

Plugin version

cordova plugin version | grep phonegap-plugin-push    2.1.3
macdonst commented 6 years ago

@mathewk2017 did you specify a notification channel in your push payload? I can't tell since you didn't add it here. What does adb logcat | grep Push look like when you receive a message?

mathewk2017 commented 6 years ago

this is the result of adb logcat | grep Push

06-28 11:06:25.218 27054 27054 D SystemWebChromeClient: file:///android_asset/www/build/main.js: Line 670 : ID: PushPluginChannel Description: undefined 06-28 11:06:25.218 27054 27054 I chromium: [INFO:CONSOLE(670)] "ID: PushPluginChannel Description: undefined", source: file:///android_asset/www/build/main.js (670) 06-28 11:06:25.225 27054 27170 V Push_Plugin: execute: action=init 06-28 11:06:25.226 27054 27172 V Push_Plugin: execute: data=[{"android":{},"ios":{"alert":true,"badge":true,"sound":"true","clearBadge":true}}] 06-28 11:06:25.228 27054 27172 V Push_Plugin: execute: jo={} 06-28 11:06:25.228 27054 27172 V Push_Plugin: execute: senderID=599761513216 06-28 11:06:25.229 27054 27172 V Push_Plugin: onRegistered: {"registrationId":"ezUup-gpu3Q:APA91bHe9GKRk7K44CpZ9H8b4Xl_UHmx4aWzDQAYh_dF8xZCL-yeP26FNISIlMk-29ZD42s3_ICGefuq9Nc4u5VS5ecC16meRpQQYGVr394yPGODUsCf8Xa_QtK6rxVOfwtmUr9l3sVZMzD28TiGbCdG90F3DECVzQ","registrationType":"FCM"} 06-28 11:06:25.229 27054 27172 D Push_Plugin: no icon option 06-28 11:06:25.229 27054 27172 D Push_Plugin: no iconColor option 06-28 11:08:44.064 2958 2958 I PushLog2949: [main-1]action is com.huawei.intent.action.PUSH(android/null:27) 06-28 11:08:44.065 2958 2958 I PushLog2949: [main-1]broadcast(),and mReceivers 4(android/null:41) 06-28 11:08:44.068 2958 2958 I PushLog2949: [main-1]dispatchIntent over(android/null:71) 06-28 11:08:44.068 2958 2974 I PushLog2949: [ReceiverDispatcher-108]heartbeatArrive(android/null:4) 06-28 11:08:44.072 2958 2974 I PushLog2949: [ReceiverDispatcher-108]heartbeatArrive, send heart beat(android/null:33) 06-28 11:08:44.083 2958 2974 I PushLog2949: [ReceiverDispatcher-108]not support bastet in wifi(android/null:21) 06-28 11:08:44.084 2958 2974 I PushLog2949: [ReceiverDispatcher-108]init push bastet failed!(android/null:33) 06-28 11:08:44.085 2958 2974 I PushLog2949: [ReceiverDispatcher-108]set HEARTBEAT_RSP_TIMEOUT Alarm(android/null:69) 06-28 11:08:44.096 2958 2974 I PushLog2949: [ReceiverDispatcher-108]ready to Send:DA(android/null:78) 06-28 11:08:44.098 2958 2974 I PushLog2949: [ReceiverDispatcher-108]send msg to remote srv success(android/null:93) 06-28 11:08:44.281 2958 26039 I PushLog2949: [SocketRead_11:05:22-1212]received a msg cmdId:DB(android/null:234) 06-28 11:08:44.319 2958 26039 I PushLog2949: [SocketRead_11:05:22-1212]broadcast(),and mReceivers 4(android/null:41) 06-28 11:08:44.320 2958 26039 I PushLog2949: [SocketRead_11:05:22-1212]dispatchIntent over(android/null:71) this is the sample payload

"to": id, "data": { title: "Onepawaway Notification", body: msg.msg, style: "inbox", summaryText: 'There are %n% notifications', "content-available": "1", Id: randomid, android_channel_id: "PushPluginChannel" }, "priority": "high",

Result in Server {"multicast_id":6950862369758068867,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]}

macdonst commented 6 years ago

@mathewk2017 ah, well it's not the plugin it's the server. You can see that the device is not registered with the server. That usually means the app on the device is registering with a different project then you are sending from.