Skip to content
This repository was archived by the owner on Feb 7, 2019. It is now read-only.
This repository was archived by the owner on Feb 7, 2019. It is now read-only.

Data not being received in intent either in launching activity or application #175

Open
@reytum

Description

@reytum

When a notification from tray is clicked the app launches but no data is received in the intent. I have tried receiving the data in app.ts and my first view classes, for the events launchEvent and resumeEvent, but the data is received as empty whereas i am getting the data in onMessageReceived callback (stringified data).

here's the login.js file'c code

   application.on(application.launchEvent, function(args) {
        var act = args.android;
         if (act) {
           var intent = act.getIntent();
           var extras = intent.getExtras();
           console.log("*****Received intent login : " + JSON.stringify(intent));
           console.log("*****Received extras login : " + JSON.stringify(extras));
          
         if (extras) {
              console.log("*****Received intent login : " + JSON.stringify(intent));
              console.log("*****Received extras login : " + JSON.stringify(extras));
          }
      }
    });

everything in this is coming as empty.

This is my onMessageReceievd callback code:

 pushPlugin.onMessageReceived(function callback(stringifiedData, fcmNotification) {
      var notificationBody = fcmNotification && fcmNotification.getBody();
      console.log("*********Recieved message from plugin : " + stringifiedData);
      //console.log("Message received!\n" + notificationBody + "\n" + fcmNotification.getTitle());
      console.log("Notification received!\n" + JSON.stringify(fcmNotification));
    });

And this is what is prints:

*********Recieved message from plugin : {"APPLOZIC_21":"{\"id\":\"11c59dc62877c832883a1cdde60217a20\",\"type\":\"APPLOZIC_21\",\"message\":236838,\"notifyUser\":true,\"totalUnreadCount\":0,\"sendAlert\":false,\"messageMetaData\":{}}","foreground":true}
JS: Notification received!
JS: null

The other issue is that the notification is received only a few time, when the app is in background. It happens randomly. Sometime the notification is received, sometimes it is not.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions