0

I am developing android and IOS app, it requires push notification,I have integrated FCM with notification payload,(IOS only supports Notification payload).So as I know in notification payload FCM itself put Notification.Once user clicks then only I can get the data of notification It doent hit onMessage received when the app is killed.If user doesnt click.If he clears how to handle it.Please help me.

Thank you.

  • Well, what do you want to do if user clears the notifications? – Aishwarya Tiwari Apr 03 '17 at 12:00
  • This was answered before. Check this: http://stackoverflow.com/questions/14671453/catch-on-swipe-to-dismiss-event – Leandro Borges Ferreira Apr 03 '17 at 12:09
  • no Actually current scenario is once user clicks I will get some data and based on that i will populate that on UI.If he doesn't click I wont get that data.In case of notification payload. – Sachin Gururaj Acharya Apr 03 '17 at 12:11
  • To be more simple If we use data payload every push notification data i can get on Onmessage received class.In case of Notification payload I can get data only once user clicks on Notification right.I want that data if user clear the notification also.If you dint get please ask I will explain again. – Sachin Gururaj Acharya Apr 03 '17 at 12:13

1 Answers1

0

Open your application while clearing the notification as Facebook and transfer payload to the application. Pending Intent should have your application's one of the activity components like.

Intent appIntent = new Intent(context, YourActivityName.class);
PendingIntent.getActivity(context, 0, appIntent, PendingIntent.FLAG_UPDATE_CURRENT));

Also you can open Services and Broadcasts

Dhalloo
  • 155
  • 3
  • 14