I can’t figure out how to set up a provisioning profile to work with In-App Purchase. I’ve been going around in circles for days, and nothing I’ve found so far has been useful.
Apparently you can’t test IAP from the simulator, you have to use a device and a test account. Ok, I have a Development profile that works when I want to test on my iPhone. I’ve been using my Development profile just fine, and I also have a Distribution profile that works for ad-hoc distribution.
But now I’m trying to add IAP and I can’t get it to work with my Bundle ID on iTunes connect.
First, I tried to create a bundle ID on the developer portal that matched what I was using in Xcode. It wouldn’t let me, saying ‘An App ID with identifier ‘xxx’ is not available’. Ok, so I made a new app ID, and used that in iTunes Connect to make my products.
But when I try to change my Bundle ID in Xcode to match the App ID I made, it won’t let me, giving me an error “Failed to create provisioning profile. The app ID “xxx” cannot be registered to your development team.”
So if I make an App ID in Xcode, I can’t use it in iTunes Connect, and vice versa.
How do I get a development provisioning profile with a bundle ID that matches my iTunes Connect, so I can test IAP? And, will I be able to switch to my Distribution profile and use the same bundle ID when I’m ready to submit?
I finally got it to run on my device.
It seems the issue was in the Build Settings. Somehow this was changed or corrupted and was pointing to my old free developer account. Under Target > Build Settings > Signing were some overrides that I guess were using an invalid profile. I changed all "Code SIgning Identity" values to "iOS Developer" and "Code Signing Style" and "Provisioning Profile" to "Automatic". Then when I rebuilt and ran my app it installed and ran properly on my device.
It seems even if you pick "Automatically Manage Signing" In the Info tab, that can still be overridden by other settings buried deep in the Build Settings tab.