0

I use "https://github.com/phonegap/phonegap-plugin-push" plugin to implement push notification in my ionic app.

When "notification" event is called this error occurs in "/android_asset/www/cordova.js" file.

 [INFO:CONSOLE(312)] "Error in Success callbackId: PushNotification1569630827
 : TypeError: Cannot read property 'info' of undefined", source:
 file:///android_asset/www/cordova.js (312)

this is the data that is pushed from the "notification" event

{
    "sound": "notification",
    "title": "Message from customer",
    "message": "testtesttesttesttesttest",
    "additionalData": {
        "info": {
            "merchantCode": 74071,
            "name": "sudesh",
            "chatSessionId": "lrzbeBImhK_Qws7qcEbjDAnBzrbXr5AVJFVrQlkZ",
            "time": "Tue Mar 14 11:04:41 UTC 2017",
            "title": "Message from customer",
            "body": "testtesttesttesttesttest",
            "type": "customer"
        },
        "dismissed": false,
        "google.message_id": "0:1489489453397457%c71401d800000031",
        "coldstart": false,
        "collapse_key": "1",
        "foreground": false
    }
}
SNT93
  • 431
  • 1
  • 6
  • 19

1 Answers1

1

Try this Change: push.on('notification', this.onNotification) To : push.on('notification', app.onNotification)