Send push notification to specific user?

空扰寡人 提交于 2019-11-28 05:45:17

问题


I'm making an app where I want to be able to set a basic notification (title, message, fire date) and have been trying to figure out the best way to setup the notifications. I'm working with Swift 3 and Firebase 3.

I don't want to use local notifications because if the user is logged in on multiple devices I want it to push to all those devices.

Is there a way to do this with FCM where a user can set a notification to fire at a specific date and time and have it fire on all (iOS) devices logged in?

If FCM doesn't have this, is there another APK that does? I've looked at Batch briefly but I'm already using Firebase.

Thanks in advance!


回答1:


If your main use case is to send a push notification to a single user for his multiple devices, I suggest you make use of Device Group Messaging on iOS. As per the docs, it is typically used for:

With device group messaging, app servers can send a single message to multiple instances of an app running on devices belonging to a group. Typically, "group" refers a set of different devices that belong to a single user.


When it comes to sending the notification on a specific date, I'm pretty sure you can set it up in the Firebase Console.

However, if you intend it to be sent from the server, you have to implement it yourself, since I think, there is no currently API available or a parameter you can set in the payload that can be modified for the message to be sent for a specific date.



来源:https://stackoverflow.com/questions/39523829/send-push-notification-to-specific-user

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