Iphone: Push Notification Testing on Production Certificate

How to test production push notifications?

The production push will work when you download the app from the App Store.

UPDATE:

You can also test the production push with an AdHoc build of the app; see Trinca's answer.

UPDATE:

Now, the easiest solution is to use Apple's TestFlight. (In TestFlight, it is easy to add new remote users, sending them an email invitation, they then download on whatever device they choose.)

iPhone: Push Notification Testing on Production Certificate

If you create an Ad-Hoc Profile, you'll find that it uses the production certificate, that's possibly the easiest way of testing it out.

UPDATE:

See the Apple documentation here

There are a number of steps to this but in essence;

1) The team leader needs to create a new DISTRIBUTION provisioning profile. This is done by selecting "Ad Hoc" rather than "App Store" when creating a new profile. Note by the way that you can't use a wildcard app id for this, you need to have a specific app id for the application although you may well have this already.

2) Setup your system so that build for archive uses a newly created Ad Hoc configuration, the steps required for setting this up are well documented online, here is one example.

3) Now when you distribute the .ipa to devices linked to your Ad Hoc provisioning profile, you will find that the push notification system is using the production servers.

As an aside, I find that testflightapp is really useful for managing the distribution of Ad Hoc builds and although I've only discovered it recently, it's saving me hours at the moment as I'm in the middle of running a beta test programme.

push notification testing in device through xcode with development SSL certificate

  1. Yes, you should install the development SSL certificate on server. You also have to use sandbox push-notification service (gateway.sandbox.push.apple.com) with this certificate.

  2. I guess they won't conflict. You should just use production SSL for AppStore app, and development SSL for test app.

  3. It's better not to increment or decrement or set badge value in code. Your server should return badge value in notifications body. For example, You can't handle push when your app is not running, thus you cant change badge value in code. But if your push contains badge value, it will be set and displayed correctly any way.

Here is the notification body example. Pass badge value for key "badge":
{"aps":{"alert":"This is message.","badge":7}}

By the way, didReceiveRemoteNotification: method always called when you app receives push. Even if the app is down, it will be called when you launch the app from push.

Unable to test Production Push Notifications through AdHoc

Turns out my error was forgetting to set the code signing settings in both Project AND Targets.



Related Topics



Leave a reply



Submit