which remote Notification certificate do I need to use with Ad-hoc - ios

I'm wondering what kind of Remote notification (APN) certificate do I need to use with Ad-hoc, development or production?
I was expecting I would need to use the production one, but surprisingly it worked with development.
Now, the issue with this, is how I'm going to make sure if I correctly generated the production APN certificate, if there is no way to test except when the app go live.

From Apple's documentation
"apps distributed via ad-hoc use the apple production push gateway (gateway.push.apple.com),
not the apple dev push gateway"
For adhoc builds use SSL certificate for production and not for development.

Related

How does Push Notifications work while in development and production mode, (pushwoosh)

So i have a question to which i could not find an answer on PushWoosh API or on google.
I have integrated successfully my application to PushWoosh. For people who knows about PushWoosh you can setup the "environment" to use sandbox or production when sending the push notification.
So when i use Sandbox i can send push notifications to my device. When i choose production nothing comes up( im guessing its because i have not launched the application to the AppStore yet?)
So am i to presume that if it works on SandBox mode, i can now upload it to the appstore and switch to production mode and the push notifications should work when the app is downloadable from the appstore?
When creating the SSL Certificates i used the "Apple Push Notification service SSL (Sandbox & Production)".
Thank you for your answers..
You can test your production mode notifications before releasing it to appstore. Apple provides a mechanism for it. You need to build an AdHoc version of your App. If you are not familiar with Adhoc distribution please refer the below link
iPhone: Push Notification Testing on Production Certificate
There is no assurance that push notifications will work in production mode if they are working in sandbox mode, so you cannot presume any assumptions. Adhoc distribution is provided by apple to test production mode notifications. Please go through the below link which provides some helpful information.
https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html
Let me know if you have any questions.

How do I switch the certificate from development to production?

I am trying to testflight my app, but when I use notifications I get an error because I have a development APN instead of a production APN. My problem is uploading it to parse. First I created a development SSL Certificate, then I went back and did a Production SSL Certificate, but I am having trouble uploading the Production Certificate because It's not an APN, rather a Apple Push Services. I also created a Distribution Provisioning (ad hoc).
Apples Push Notification service is a bit strange:
On the client side:
If you build your client with Xcode you usually build a "Debug" version of your app. In that case the registerForRemoteNotification method will create a sandbox device token for you.
If you build a "Release" version of your app the same method create a production device token for you.
On the server side:
If you have a sandbox device token you can only send a push notification to that device if you use Apples sandbox Push Notification service with your sandbox SSL certificate.
If you have a production device token then you have to use Apples production push notification service with your production SSL certificate to send a push notification to that device.
The tricky part is:
if you only have a device token you will not know if it is a production device token or a sandbox device token.
if you want to use release and debug clients against the same server, that server has to use the sandbox and the production service at the same time. And you need a mechanism to decide when to use which service.
BTW: there is a nice tutorial by Ray Wenderlich which also contains a useful PHP script for easy testing.
http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1

will push notifications with Production-SSL certificate work when I'm still testing my app? How can I know it will work?

My push notifications are working fine with the sandbox model. I just verified that the production ssl certificate is working both with direct SSL-connection and with AWS SNS. However, my device is still producing the same push token as it produced for the sandbox, and this token is not working for production-level push notifications (rejected as invalid token by Apple server). Is it supposed to work? How can I make sure push notifications are working/will work for users who download the app from the app store?
Create a provisioning profile for "Ad Hoc" distribution, using your production certificate. Sign your app with that and install. Make sure your SSL connection to APNS knows which certificate to use, depending on whether client is production or dev.

when to use dev vs distribution push notification p12 certificate

My app is not released yet, so you couldn't find it in the App Store. But it is being used by a group of private beta users (through the iOS TestFlight service). And it is hitting my production server, which is the reason for the question.
In the situation described above, what .p12 do I use? the Dev certificate or the Distribution certificate? I am asking because I am not clear on whom the distinction is for. As far as my server is concerned I don't care which one is used. I just need to send push notifications, and as long as the users get them, I am happy. And since I am using my production server, I figure I should use the production/distribution certificate. But I have a suspicion that my server -- dev or production -- has nothing to do with it. And which certificate I use may entirely have to do with the App Store. So will someone please clarify for me? Thanks.
From http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
Development If your app is running in Debug mode and is signed with the Development provisioning profile (Code Signing Identity is “iPhone Developer”), then your server must be using the Development certificate.
Production Apps that are distributed as Ad Hoc or on the App Store (when Code Signing Identify is “iPhone Distribution”) must talk to a server that uses the Production certificate. If there is a mismatch between these, push notifications cannot be delivered to your app.

iOS Push Notifications not sent for production

I have push notifications working perfectly for my app using the development aps-environment. However they do not work for the production environment. As far as I an aware, all my certificates and private keys are correct.
I am trying to test the production aps-environment on an ad-hoc distribution provisioning profile, not my App Store profile.
I'm wondering us it even possible to test production push notifications with an ad-hoc profile?
Is there anything else I should be checking for?
I just had the exact same issue. Drove me crazy for a day. Did you change the APNS server URL in your PHP script to 'ssl://gateway.push.apple.com:2195' ? This is different from the what is used during development.
Also make sure you have all the production certs in place, etc...
Yes, it is possible to use production push notifications with an Ad-Hoc profile; Ad-Hoc is considered to be production just like the App Store profile. Make sure you are:
actually building your app with the production profile (not development),
using the production push cert on your server (not development), and
hitting the production apple push gateway server (not the sandbox).
Apple keeps the development environment completely separate from the production, so if those three things do not line up, it will not work. You cannot mix and match them.
If you are sure your certificates et al are correct, also check that you're trying to send to your payload to the Production push token of your device. Each device has two distinct push tokens - one for development and one for production. You cannot send a push notification to a development push token via a production certificate.

Resources