-
Notifications
You must be signed in to change notification settings - Fork 1.9k
JS error in "Success callbackId: PushNotifiation###.." whenever a notification is sent to the device #824
Comments
So I followed the tree and realized that I was incorrectly assigning the callback function. I changed:
To:
I kind of think the code should present a more useful error if the handler is not valid It's misleading seeing an error in cordova's code right after the android native code callback occurs |
…ever a notification is sent to the device
@csga5000 great catch, I've fixed it for 1.7.0. |
Awesome, thanks for your effort. |
…ever a notification is sent to the device
…ever a notification is sent to the device
…ever a notification is sent to the device
…ever a notification is sent to the device
hi sir ,
|
@alrazyreturn well first off you are not using the push plugin you are using the local notification plugin. Regardless, your problem is already diagnosed by the error you see in console.log,
that function or variable |
Many thanks sir, |
What version of the PhoneGap Developer app are you using?
|
Many thanks for your replay, |
…ever a notification is sent to the device
…ever a notification is sent to the device
…ever a notification is sent to the device
…ever a notification is sent to the device
…ever a notification is sent to the device
This thread has been automatically locked. |
Expected Behaviour
The server sends a notification while the app is open and the app's javascript callback push.on 'notification' is called
Actual Behaviour
The server sends a notification while the app is open an an error is written to the console:
Reproduce Scenario (including but not limited to)
Sending a notification to iOS or Android device while device is open
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
Android 4.4.3 and 6.0
iOS 8.4.1
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
ASUS (an old nexus) and HTC (m9)
Cordova CLI version and cordova platform version
Plugin version
Sample Push Data Payload
Android:
{ body: msg, title: title, icon: "ic_stat_notification" }
iOS:
{ aps: { alert: title, sound: 'true', badge: 1 } }
Sample Code that illustrates the problem
Logs taken while reproducing problem
The last two lines are all that really matter.
Edit: The "Error in Success callbackId" is actually being logged on cordova.js line 268. It says deviceready.js line 5 because I wrapped console.log in my own function
Edit:
Just for the heck of it I did a little debugging. Also, I updated android/my windows machine to 6.1.1.
So the error is on cordova.js line 293.
The exception thrown:
callback.success is:
And args is:
The text was updated successfully, but these errors were encountered: