简体   繁体   English

如果用户清除推送通知,如何处理?

[英]If user Clears push notification How to handle?

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. 我正在开发android和IOS应用程序,它需要推送通知,我已经将FCM与通知有效负载集成了(IOS仅支持通知有效负载)。所以我知道在通知有效负载中FCM本身放了Notification。一旦用户单击,只有我可以获得通知数据,它确实会击中应用程序被杀死时收到的onMessage。如果用户没有单击,如果他清除了如何处理它,请帮助我。

Thank you. 谢谢。

Open your application while clearing the notification as Facebook and transfer payload to the application. 打开您的应用程序,同时清除Facebook通知,并将有效负载传输到该应用程序。 Pending Intent should have your application's one of the activity components like. Pending Intent应该具有应用程序的活动组件之一。

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

Also you can open Services and Broadcasts 您也可以打开服务和广播

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM