开发者

Apple Push Notifications to specific Users

开发者 https://www.devze.com 2023-04-12 22:26 出处:网络
as far as I understand APN\'s I can only send them to the app not a specific user that uses my app. Is there a way of sending APN\'s only to specific users that use my app? I can\'t think of a way o

as far as I understand APN's I can only send them to the app not a specific user that uses my app.

Is there a way of sending APN's only to specific users that use my app? I can't think of a way of开发者_运维知识库 doing this...

Greetz


APNS is not a broadcast medium. As it says in the documentation:

Apple Push Notification service transports and routes a notification from a given provider to a given device.

When you send a notification from the server, one of the paramters is the device ID.


Apple's Push Notifications are always sent to specific 'users' (a specific device being an iphone, ipad)

What you do when you want to use APN is register the application for push notifications. Then you get a token that links the user's device to the notification service. You then use this token to 'push notifications' to APN which will in turn send a notification to that device. Notifications are pushed by 'Providers'.

Here's apple's documentation on the matter: Apple Push Notifications

Look up 'Registering for Remote Notifications' to register the device and 'Handling Local and Remote Notifications' to handle the incoming notifications.

Read up on how to send notifications here: Providers


It is possible. I use Easy APNS and in newMessage() you can specify the PID (saved in a MySQL database) of the user.

Have a look at http://www.easyapns.com/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号