views:

282

answers:

1

I am developing an application in which i want to use push notification service.i have a sever.now i want to know that how do i handle multiple devices? is there a unique device id/name for every iphone? suppose i want to delete request for a specific device token,so how do i handle multiple users? is there a way i can generate unique name for every device through application?

+1  A: 

You should really read the APNS documentation, this is all explained in depth there.

The short answer is that when you launch an app on the phone it requests a push notification key from the OS. You then take that key and send it back to your server. Your server uses that key when it sends a push via Apple's servers to indicate the devices to send the push out to.

The service just gives you a token. If you want accounts or device names you need to come up with them and store them with the credentials on your server.

You handle multiple users by same way you handle single users, you send message with the appropriate key to the service.

As for deleting a request, you can't. It is like a text message, there may be some latency before hits the device, but the moment you commit the push it could be delivered instantly.

Louis Gerbarg
i just want to store scheduled time on server.suppose i start a countdown timer.starting at two hours.now when i close the app send a request to the server that before time expires show a alert on device something like you have 30 minutes left or your time expires after 30 minutes
Rahul Vyas
also tell me will i need to request for device token every time when app launches? And does APNs generate new device token every time for a particular device or it remains same for a device.it doesn't matter how many time we request token from APNS
Rahul Vyas
The Apple servers don't let your post date a request, when you send them they go. If you want to delay it you set that up between your app and your server. But as soon as your server sends the push requests to Apple it is irrevocably sent. Yes, you need to request a token every time you launch your app, no it doesn't always change. This is spelled out in detail in the docs I linked above.
Louis Gerbarg