How could you know which certificate is used by Xcode? - ios

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.

Related

Deploy iOs app with iTunes without registration

I have just developed our new iOs app and deployed it through iTunes to my iPhone.
I don't want to use the app store because it's an internal app. I would like to be able to send a link to the ipa and for someone to be able to download it and install it through iTunes. Is that possible?
The only solution I have came across so far is registering the receiver iPhones in my provisioning and use the ad-hoc deployment process.
We used to have an ipa that would install as described on any iPhone without any kind of registration.
I am bit confused between ad-hoc distribution and in-house distribution...
Would paying €299 for an organization account solve that?
Thanks!
Victor
Yes, you will need to shell out those €299 if you ever wanna get into serious app development.
Yes, you are correct, registering the receiver iPhones in my provisioning and use the ad-hoc deployment process can be done easily but will start to wear you out once the number of test devices start to go up.
This Apple Doc is the perfect guide to get you started with setting up an internal distribution host service.

Apple's TestFlight and Push Notifications

I'm working on an app and testing it with my partners via Apple's New TestFlight. I've never had issues with the old TestFlight system but now all of a sudden if I install the app via USB Cable & Xcode notifications come streaming in.
However if I install via Apple's TestFlight notifications never get delivered.
I'm using Parse for notifications and again have never had any problems. Anyone else have any issues or advice? Pretty frustrating.
Ok. Well it would seem that Apple's New TestFlight considers any version pushed "production". Therefore you must have a production certificate generated as well. Best best is to use an AdHoc Provisioning Profile which will use the production push certificate. Don't use a Development Provisioning Profile with a Development Push Certificate.
The more you know...

APNS Push notifications are not working if app is installing from iTunes and working if app is running from Xcode

i have used app with ios8.0 SDK and created explicit app id which is enabled push notifications for development environment
I have create provision profile for explicit app id and added profile to Xcode and run the app , then device token is generating, by using NWpusher i have tested notifications. notifications are working fire.
If we build the app and created ipa and installing that ipa on same device, generating different device token, and by using that device token in NWpusher app notifications are not working
Here i have used only developer environment for notifications
You have to repeat the exact same procedure that you undertook for the development certificate and testing in Xcode, once again only now for the production environment.
Getting push notifications to work can be a real pain, thus it is important to take a structured approach. Your issue is actually quite common, people tend to think that once they got push running in dev mode, it'll work in production mode immediately. This is not the case.
I recommend you to go through Ray Wenderlich's Tutorial on Push and take it step by step. They are demonstrating the case with a dev certificate as well, but the in the end they state the following (and this part is very often overread, they should point it out more clearly):
When you are ready to release your app, repeat this process for the
production certificate. The steps are the same.
You need to generate certificate and environment for distribution to work

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.

APN and Ad-Hoc Builds

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.).

Resources