Question

I want to add push notification for my app. I googled an got the stuff running in test mode. I:

  • set up the certificate, provisioning profiles, everything
  • set up a live server
  • obtained my device code
  • used simplepush.php to send a push to my device

and voila; I got a push message. But now what?

I want to add my app to the App Store in a few days so how does this work in real life?

1) What else except the provisiong profile from developer to distribution (both for the app and push) and the server sandbox.push.apple.com to push.apple.com do I have to change? 2) To what device code do I send the push with simplepush.php? Do I need to save every single device code in a database somewhere and send it to every device code using a script (and Apple checking if that device really wants the push) or is apple taking care of it all and can I just send it to my own device code? Or something else? 3) ...?

Any clarification is greatly appreciated. Thanks in advance!

Was it helpful?

Solution

You need to keep track of all the device tokens. If you send apple a push for your device alone that is the only device that will receive it. You also need to regularly connect to the apple feedback server to get a list of device tokens that are no longer valid.

Depending on your needs, and the scope of your project it may be worth looking at using a third-party push provider (such as urban airship) that will handle all of this for you, especially if you are just wanting to "broadcast" notifications which I assume is the case based on your question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top