0

Sorry for my english. I spend meny timis for fix this bug but i cant do this, i dont know why i cant get data which get from server. I have extends IntentService class, they pase data for push. I parse lke this:

  @Override
    protected void onHandleIntent(Intent intent) {


        Bundle data = intent.getExtras();
        String login = data.getString("login"); //null
}

if i use extends FirebaseMessagingService everething fine. I get data, i parse like this:

public void onMessageReceived(RemoteMessage remoteMessage) {
        String login = remoteMessage.getData().get("login");
}

But i cant use FirebaseMessagingService becouse when i close app, Firebase create own notification whitout my data. My qestion: how parse date when extends from IntentService ?

server send to firebase json like this:

{
"to":"/topics/news",
"notification":{
"title":"test",
"body":"Test",
"icon":"icon_notf"
},
"data":{
"login":"test"
},
"priority":10
}
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
b1065579
  • 155
  • 1
  • 1
  • 9
  • https://www.simplifiedcoding.net/firebase-cloud-messaging-tutorial-android/ simply follow this link. – prakash Jul 15 '16 at 12:58
  • @prakash thanks for link. But when i extends from `FirebaseMessagingService ` and my application is closed firebase create own notification. They dont care which icon or sound i set in my class which create notification. – b1065579 Jul 15 '16 at 13:01
  • Extending IntentService is not the solution. Solution is much easier, see my answer in linked question ^ – Tim Jul 15 '16 at 13:03

0 Answers0