I am providing APNS in iOS and everything is working well , the problem it is each time I run the app it gives me the device token and then store it in MYSQL database.
my question , is this going to be same after I distribute the app in apple store , am I going to receive the device token each time the app being lunched from users ?
other question , If the app is ready to be distributed , do I have to change the Development Push SSL Certificate ? if yes , is it the same steps ?
The device token is registered every time the application is launched, so yes you will receive their device token every launch if it’s sent to your MySQL database in your
didRegisterForRemoteNotificationsWithDeviceTokenmethod. This is important because if the user deletes the app/disables push notifications for that app, after a certain amount of unsuccessful attempts to send them a Push notification, you can then mark that device token ‘inactive’ and remove it from the database. (Urban Airship helps with this and all other Push functions, worth a look if you have more troubles with your current implementation.)Ensure you’re using an
UPDATEor equivalent command in your MySQL database, so that the same token isn’t adding multiple times to the table and filling it up. Alternatively you could make the Device Token field Primary so that attempting to add the same token more than once would fail, but that’s messier.As for the Development Push Certificate, yes, you’ll have to change it to the production certificate. The Dev certificate only allows you to connect to Apple’s sandbox APNS server for testing and debugging. Before submission to the App Store, you have to change to the production certificate that uses the live servers. The process is similar, you go into the App IDs section of your Provisioning Portal, and in the Configure section of that app you configure and download the Production Push certificate in the same way you did for the Development one.