Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PushNotifications: Empty Body with FCM on Android #128

Closed
renzska opened this issue Jul 10, 2017 · 1 comment
Closed

PushNotifications: Empty Body with FCM on Android #128

renzska opened this issue Jul 10, 2017 · 1 comment

Comments

@renzska
Copy link

renzska commented Jul 10, 2017

I'm receiving the following in the parameters field of the OnMessage:

[CrossPushNotificationListener] OnMessage: parameters = {
  "google.sent_time": "1499665101267",
  "google.message_id": "0:1499665101275766%fd798786fd798786",
  "notification": "Bundle[{body=You have a new message., icon=/hubtest/firebase-logo.png, title=}]",
  "collapse_key": "com.my.app"
} deviceType = Android

However, my notifications while the app is open has the body empty.

If the app is not in the foreground, it shows the body in the notification.

I tried the following, but it did not work:

      CrossPushNotification.NotificationContentTextKey = "body";
      CrossPushNotification.NotificationContentTitleKey = "title";
      CrossPushNotification.NotificationContentDataKey = "notification";

Any suggestions?

Thanks!

@renzska
Copy link
Author

renzska commented Jul 13, 2017

I was able to get it working by modifying my payload sent to Azure.

I was originally sending:

{
    "notification" : {
      "body" : "You have a new message.",
      "title" : "AppName",
      "soundname": "default",
      "badge": 5
    },
    "data" : {
      "body" : "You have a new message.",
      "encounterId" : "123"

    }
}

I modified it to send:

{
    "data" : {
      "message" : "You have a new message.",
      "title" : "AppName",
      "soundname": "default",
      "badge": 5
    }
}

And that worked fine without having to set any of the NotificationContent Properties.

Thanks for your work on this Plugin!

@renzska renzska closed this as completed Jul 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant