Initializing my new AD-HOC profile for testing Push Notifications on Production - ios

I want to test Push Notifications in iOS production version before I publish it. I understand I cant sign it with distribution profile ,only AD-HOC profiles.
So I created an AD-HOC profile, selected the right bundle, selected my device that I work with and created a new profile. I downloaded it and after that I select it in:
Provisioning Profile -> Release - AD-HOC-NEW
Provisioning Profile -> Debug (Any SDK, Any iOS SDK) are with Automatic.
It compiles and installed on my device through Xcode but notification don't come.
When I try to change Debug settings also to my new profile I'm getting an error :
"No provisioning profiles with a valid signing identify(i.e certificate and private key pair) were found.
No codesigning identities (i.e certificate and private key pairs) that much the provision profile specified in your build settings ("AD-HOC-New") were found. Xcode can resolve this issue by downloading a new provisioning profile from the member center."
I press "Fix Issue" but It dont fix it...
What could be the problem?

I think you should install your binary not straight xCode but as a real over-the-air/ ad hoc deployement.
The consequence is that your application will request at launch not a token from the sandbox environment but from the production one, and this will match your certificate (which is a production one too).
You do a real ad-hoc deployement both by installing your .ipa through iTunes, or by using a solution such as Testfligt.

Related

None of the valid provisioning profiles include the devices - Distribution

I read online we need a separate distribution provisioning profile if we want to distribute an app to the app store. I know there are answers already on StackOverflow for this error but I think mine pertains to my Distribution provisioning profile.
So right now I have two provision profiles, one for developer, and another for distribution. The app will build and run successfully on the same device when Code Signing Identity under "Build Settings" is set to iOS Developer. But when I switch Code Signing Identity to iOS Distribution and run on the same device, I get the error "None of the valid provisioning profiles include the devices". When I try the option to let Xcode "fix the issue", it says that
"Xcode failed to resolve the issue. Check your code signing settings; ensure you have a matching signing certificate and provisioning profile installed; and try again."
The provisioning profile for distribution is active on the Apple Developer site. When I try to reset in Preferences I still get the error
You can not run on a device with the Distribution profile. That's just for doing a build/archive and then submitting that to the store. If you want to run the production build on your device, submit to iTunes Connect and use TestFlight to install that build on your device.

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, i.e. 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 :
updated AppID settings to 'Production' Push Notifications
created a production SSL certificate, uploaded it to Parse Server
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'
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 :
And, naturally, I can no longer receive/send push notifications. Here's what I tried so far :
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!
Actually, I noticed that whenever I submit the build, Xcode automatically selects a wildcard provisioning profile :
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 ?
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.
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.

How can i change between developer and distribution signing identites xcode?

I have submitted an app to the app store. When i did this i was developing my app with a developer signing identity, then i created a distribution signing identity but i couldnt get xcode to use the distribution identity, so i deleted the developer identity and set only the distribution. Now i want to do things right, so i managed to import both identities in xcode and i can see them in xcode -> preferences -> view details
What's next? how do i generate the binary to upload it to the itunes connect using the distribution identity? Any tips about uploading an app to the app store will be helpful.
If you are confirmed the provisioning certificates are correct for both the development and production, you will have to set the correct Code Signing Identity and Provisioning Profile under the Built Settings for both Project and Target.
Debug -> Development
Release -> Production
This way, when you are developing and you run the project directly from XCode to your device, it will be using the development certificate. If you achieve it and extract to IPA. Then, it will be using the production certificate.
If you have a third certificate (Ad-Hoc Production) for beta testers, you may interchange that under the release with distribution certificate.
See the screen shot below.
Follow steps:
First create distribution provision certificate with valid bundle identifier on apple account(For this you should have the main distribution certificate).
Download and double click on certificate.
Then give bundle identifier name which you used while creating certificate in plist.
in Code signing select certificate of distribution
Clean build and archive it.
validate with iTunes and create ipa. then upload build using application loader on App Store.
Hope this will help. This is the common procedure of creating certificate, .ipa and uploading build.

XCode: iOS Enterprise in house app signing errors

I'm using XCode 5, iOS 7.0.6, iPhone 5S
My company is trying to deploy a test inhouse app with the enterprise program (not the actual app, we just want to try figuring out the deployment). I have been invited as a member to the enterprise program, and I requested a development certificate through XCode.
In the Build Settings, I have:
Code Signing Identity -> iPhone Developer: ...
Provisioning Profile -> iOS Team Provisioning Profile: * (Wildcard)
It builds and archives fine, but when I tried installing the app, I received an error "The executable was signed with invalid entitlements." After googling, I followed the suggestions to toggle a setting in the Capabilities tab. I clean, build, archive again, and this time, I'm getting the error "A valid provisioning profile for this executable was not found." Am I setting the code signing/provisioning profile incorrectly? Those are the only ones I have access to.
I am unclear of Developer Certificate vs Distribution Certificate; do I need a Distribution Certificate to install the app on devices?
Note: I'm trying to install the app through Apple Configurator, since that's how we want to deploy the app to employee devices.
You need a Distribution Certificate if you want to install it Ad hoc.

Push notifications don't work if app is installed via iTunes but they do if installed by XCode

I have an app that uses push notifications and I am trying to distribute it to testers for testing.
If I create an ad-hoc distribution which gets installed via iTunes then everything works except for the push notifications, which never arrive.
But if the app is installed using XCode then the push notifications do arrive.
When I build for installation using XCode I set the code signing identity within XCode to my development profile. When I build for ad-hoc distribution I set the code signing identity within XCode to be the ad-hoc distribution profile when building the archive, then sign the archive for distribution again with the ad-hoc profile (I found this was the only combination that would allow installation via iTunes without an error message).
All the devices have been added to the ad-hoc distribution profile and to the apple push profile (and also to the team provisioning profile), the profiles have been renewed and refreshed within XCode.
Even with my own iPhone I can get push notifications to work if I install with XCode but not with iTunes.
Am I signing the ad-hoc distribution with the incorrect profiles, if so what is the correct combination of profiles?
Is there another reason why the push notifications don't work for the ad-hoc distribution but do when the app is installed via XCode?
These are the profiles used:
1) Apple push profile which has an App id of abcdef.com.company.mno
2) Project Development profile which has an App id of abcdef.com.company.mno
3) iOS Team provisioning profile which has an app id of abcdef.*
4) AdHoc Distribution profile which has an app id of abcdef.com.company.mno
5) My developer profile which has an app id of abcdef.com.company.mno
** since first posting this I tried creating a new iOS Team provisioning profile using the abcdef.com.company.mno app id but it made no difference **
The abcdef.com.company.mno App Id is showing Push Notifications for Development as being enabled (which is correct, we are not yet using Production pushes). Also its Development Push SSL Certificate is showing as enabled.
The code signing identities are: first pic what I use for installing/running using XCode, 2nd picture when building an archive for ad hoc distribution.
The description for the iPhone Distribution profile in XCode says: "Ad Hoc distribution profile (for bundle identifiers com.company.mno)".
This morning I had a similar issue trying to compile an In House app (I think it's the same issue). I had the iPhone plugged to the computer and I saw in console one warning like: entitlement 'aps-environment' has value not permitted by a provisioning profile
I tried this solution, but I had no success:
'aps-environment' has value not permitted by a provisioning profile
So, my app was working correctly in release mode running from Xcode, but when I tried to export with Ad Hoc certificate my iPhone shown that message on console.
Finally I went to profiles in iPhone and deleted all. I went to profiles in Organizer and deleted all too. I edited the provisioning profile via Provisioning portal and downloaded them again.
I changed code signing to Don't code sign. Changed again to In House provisioning profile, exported to a file and everything worked fine!
You're probably signing the adhoc version with a wildcard app id provisioning profile. Make sure the Code Signing Identity in the build settings is explicitly using your explicit-app-id provisioning profile.

Resources