1

Is there possible to handle click on FCM notification which created by android (it happens when application receive push in background). I saw this one of possible way solve this problem.enter image description here In documentation i found one interesting moment (see picture). So, how i can make it?

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
Kota1921
  • 2,451
  • 1
  • 10
  • 13
  • Possible duplicate of [Firebase (FCM): open activity and pass data on notification click. android](https://stackoverflow.com/questions/40181654/firebase-fcm-open-activity-and-pass-data-on-notification-click-android) – Kota1921 Nov 16 '17 at 09:51
  • I've finally found solution - https://stackoverflow.com/questions/40181654/firebase-fcm-open-activity-and-pass-data-on-notification-click-android – Kota1921 Nov 16 '17 at 09:51

1 Answers1

0

We can do a hack.I don't know it's a proper method.But it works !!

Do the below check inside the onCreate Method on the Activity which is opening on the notification click.

protected void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
if(java.lang.Integer.toHexString(getIntent().getFlags()).equals("14000000")) 
{
  //Activity is launched from the notification created by android
}
}

For other cases where notifications are created in our FirebaseMessagingService class. You can pass an intent extra and check if it is present in the activity onCreate Method