This repository was archived by the owner on Sep 4, 2020. It is now read-only.
Description Expected Behaviour
App should not crash when app is open and a notification is sent.
Tray should show notification when app is in background and a notification is sent.
Actual Behaviour
App crashes (Unfortunately this app has stopped working) when app is open and a notification is sent.
Tray does not show notification when app is in background and a notification is sent.
Reproduce Scenario (including but not limited to)
As listed above
Steps to Reproduce
As listed above
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
Android 5.1
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Micromax Q412
Cordova CLI version and cordova platform version
Phonegap CLI 7.0.1, Android 6.2.3
Plugin version
2.0.0
Sample Push Data Payload
'data'=> {
'title' => "Hello World",
'body' => "Did you practice today?"
}
Sample Code that illustrates the problem
config.xml is---
<platform name="android">
<resource-file src="google-services.json" target="/google-services.json" />
</platform>
<plugin name="cordova-plugin-device" spec="2.0.2" source="npm" />
<plugin name="phonegap-plugin-push" spec="2.0.0" source="npm">
<variable name="SENDER_ID" value="1:XXXXXXXX:android:YYYYYYY" />
</plugin>
Javascript code has:
function onDeviceReady()
{
registerForFCMPushNotifications();
//... more code
}
function registerForFCMPushNotifications()
{
var notificationObj = PushNotification.init({
android: {
senderID: "XXXXXXXXX",
badge: "true",
sound: "true",
vibrate: "true",
topics: ["all"],
forceShow: "false"
},
ios: {
},
windows: {}
});
notificationObj.on('registration', function(data) {alert('Id='+data.registrationId);});
notificationObj.on('notification', function(data) {alert("Got notification");});
notificationObj.on('error', function(e) {alert( e.message );});
}
Logs taken while reproducing problem Reactions are currently unavailable