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.
Related
My Xcode has both development and distribution certificates that it manages by itself. I don't know how it picks either of the certificates when I build and run my project. I'm using Apple Push Notification Service in conjunction with Amazon. I ask for a device id from Apple and send it to Amazon where it can be used to publish notifications to Apple and then to my device. It seems that when I switch between debug and release mode, somehow a wrong certificate is used because Apple rejects the token id that I had just gotten from them and passed to Amazon. I've read that this could be due to the incompatibility between development and distribution environments on both platforms, meaning that both platforms should work in development or distribution.
I'm sure that the Amazon one is set to distribution because I manage it myself. But I don't know the token that I got from Apple has given to me by the development or the distribution certificate because Xcode manages it. Is there a way for me to know what certificate Xcode uses at any given time? And is there a way that I can specify it for Xcode? Thanks!
P.S. The app used to work fine in both development and distribution environments before, and I haven't made change in this regard other than switching between debug and release.
I have a small question about iTunes connect beta testing.
So for this we have to upload a build to the app store and then enable internal tester. As Xcode does not allow us to sign an app with Ad Hoc provisioning profile to upload it to app store and it has to be the distribution profile to upload it to app store.
So my question is that when i sign it with distribution profile the push notification use the production server, and may be my production server is not ready at that time so how should we can get around this issue.
So there are two thing one the production server for the push notification and other is the production server for API calls. I can always use development server URLs but when i sign with distribution profile. I Think it will automatically use the production server for the Push notifications
Use the distribution certificate, and in your development server use the same distribution push certificate .PEM (you can re-use this .pem later on your distribution server).
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.
I hope this is not a question that has been asked 1000x, I couldn't find a good answer.
In order to distribute apps to our testers we use ad-hoc builds. The trouble we are having is that APN stopped working for the ad-hoc builds. The servers that are used by the adhoc builds are using the production push SSL certificate and production service endpoints.
My questions:
1.) Does apple permit using the production APNS if the app is not distributed via the app store? Do you need an enterpise account for that?
2.) Are there proven recipes to track down errors? The feedback service from apple has not returned anything ever.
Thanks for any feedback,
Stan
I'm not positive that it is a requirement (though I believe so), but we have sent notifications using the production cert from an enterprise account.
The feedback service will tell you if a token is no longer good, but in general it fails silently once the request has been successfully sent off to Apple (your framework can provide errors such as ports being blocked etc.).
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.