简体   繁体   中英

APN & TestFlight : Xcode chooses a wrong (XC*) provisioning profile to submit archive

I am using Parse.com to send client push notifications, from one iDevice to another.

It works well with the 'development' setup, ie with - the Push Notification Setting of the appID set on 'Development'
- a development SSL certificate - a development provisioning profile With this setup, I managed to send a push notification to myself (sender = receiver = my device).

Now I want to test the communication between 2 different devices. To do so, I use TestFlight (because this is the way I usually send updates to my client). I followed all the recommended steps to move from Development to Ad Hoc :

  1. updated AppID settings to 'Production' Push Notifications
  2. created a production SSL certificate, uploaded it to Parse Server
  3. generated a new Provisioning Profile set for Ad Hoc Development, and installed it on the iPhone (checked on Organizer Library). This Ad Hoc Provisioning Profile is named : 'PushMyMoving_Push_Production_Profile'
  4. updated the Project/Target build settings under 'Code Signing' to tell Xcode that it should use PushMyMoving_Push_Production_Profile (and the corresponding iPhone Distribution Certificate) for now on.

The issue : the build is successfully submitted, but as soon as it is, Apple sends me this e-mail : 提交后来自Apple的错误消息

And, naturally, I can no longer receive/send push notifications. Here's what I tried so far :

  1. I opened the PushMyMoving_Push_Production_Profile to see if the Push Notification Entitlement was missing. It isn't. So my guess is that Xcode doesn't submit/archive the build with the right Provisioning Profile, although I'm telling it to do so in the Build Settings !
  2. Actually, I noticed that whenever I submit the build, Xcode automatically selects a wildcard provisioning profile : Xcode生成的通配符配置文件
  3. I tried to delete all the wildcard provisioning profile from Member Center & my Mac, but (annoyingly!) Xcode automatically re-creates them whenever I refresh the Provisioning Profiles Panel under Xcode>Preferences>Accounts. Is there a way to completely erase wildcard profiles ?
  4. This thread : XCode 6 and Ad-Hoc distribution without XC: provisioning suggests that it can be that the "ad-hoc profile doesn't contain all of the devices on your team" but I carefully checked ALL the devices I have when I generated the Ad Hoc profile.
  5. I've also tried to edit & re-generate, re-install the provisioning profile (a common advice apparently) but Xcode still does it its way.

Any help would be much appreciated! I have been struggling for days, it is really frustrating when the problem does not come from the code ! Thanks

Thanks Rhythmic Fistman for the help. I found the answer today : I was submitting my build to TestFlight with an Ad-Hoc provisioning profile, instead of an AppStore Distribution Provisioning Profile. I had read somewhere that Xcode was creating a Ad-Hoc provisioning profile behind the scenes while submitting to TestFlight, so I thought that the Ad-Hoc profile was appropriate. But since TestFlight runs like the AppStore, not having registered the subscribed devices UDID in advance (as with Ad-Hoc distribution) it makes sense to use a "broader" profile such as an AppStore Distribution Provisioning Profile.

So for anyone using Push Notifications with Testflight, you do need an AppStore Distribution Provisioning Profile. Then Xcode will automatically picks it for the submission phase.

Expunging wildcard provisioning profiles from Xcode and the developer portal can be done, but you can probably fix your problems by explicitly setting your Release Provisioning Profile to the correct Ad Hoc profile in your build settings:

构建设置中的配置文件

This should stop Xcode getting too creative when Archiving.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM