Sending Firebase Push Notifications to Logged-in Users Only

孤者浪人 提交于 2021-02-04 21:46:19

问题


I developing an iOS application that integrates with Firebase to deliver remote push notifications.

The application includes a login feature, and sending a notification using the FCM token sends it even though the user is not logged-in, and I get why that happened because the FCM token is an app-device combination not an app-user combination.

But is there a workaround to guarantee that the notification is only delivered when the user is logged-in?


回答1:


Push notification are not linked with user status. If you can, you should track user state on your server, checking a login token for example, to check if the user is logged in or not. But i think that you can't be completely sure for the user state.



来源:https://stackoverflow.com/questions/56969940/sending-firebase-push-notifications-to-logged-in-users-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!