I am currently working for a large client where things move slowly. I am in charge of fixing some issues for push notifications. When I run the app I get the following error:
didFailToRegisterForRemoteNotificationsWithError
Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x1753edb0 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
The problem happens because I am using a Xcode managed profile that does not have push notifications enabled. What are different ways of obtaining that profile which has push notifications enabled? Does the client have to add me as a developer in their Enterprise program?
If I obtain the provisioning profile file from the client I do not think it will work since I believe it needs to be attached to the certificate created on my machine! I may be wrong on this. Looking for different suggestions!
Ask your client to create the four certificates:
The Development
The Distribution
The Push Development
The Push Distribution
Install those on the OS X Keys, then export those certs into a .p12 file. Then get this file to your computer, install the certificates from the .p12 file, and then he can export the provisioning profiles to you and they will work in your computer like a charm!
I think this link will help him do what I said.
Related
I'm trying to set up iOS push notifications via OneSignal for a second app on my developer account, but all of a sudden I'm getting this error:
"Your production certificate was rejected by Apple. It may be expired, revoked, or invalid. Double-check your file or use our provisionator tool to auto-generate a valid certificate."
Image: OneSignal Error Message
What's strange is I didn't have this problem at all for my first app, but now it's giving me this error. I've followed the documentation at https://documentation.onesignal.com/docs/generate-an-ios-push-certificate and the claim from Certificate being rejected by Apple that the issue has been resolved on Onesignal's side doesn't seem to hold true. I've also tried deleting all expired/revoked certificates in the keychain but the error persists. Could this be an issue with different certificates for multiple different apps?
Just stumbled across the same issue today.
Solved by generating a new APN cert with a different CSR, download the APN cert and install to keychain, export the .p12 and upload to OneSignal.
While I am attempting to upload Production certificate on Parse.com for Push notificatation.
There is error message
Unsupported certificate type. Common Name (CN) must contain one of:
Apple Production IOS Push Services, Apple Development IOS Push
Services, Pass Type ID, Apple Development Mac Push Services, Apple
Production Mac Push Services.
After some research I came to know that.
While we are exporting Production certificate from Apple,
Common Name before was : Apple Production IOS Push Services:[Bundle name]
And Now : Apple Push Services:[Bundle name]
May be this is the reason Parse fails to validate certificate.
Please give solution if any.
It seems problem is solved now by Parse.
You can face error
Could not connect to Apple with this certificate
If so, revoke your APNS certificate and regenerate it.
And then create .p12 file with this new certificate. and upload it.
I have successfully uploaded .p12 file.
I've made a very basic app for push notifications using my personal ios developer account. I wanted to share this with a remote coworker but it's proving to be a struggle.
I added his device to my developer account, and I've created a new provisioning profile with his device for my app.
I sent him the certificate, and he ran it on his computer.. and then built the app on his phone. He got this error:
Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x17007e880 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
i had him check Xcode -> Preferences -> Accounts and this is his screen. I think he has an expired developer account, but can somehow still build apps on his phone??
he doesnt want to pay the $99. I'd add him as a developer on my "team" but I have an account as a single developer. What is the easiest way to get this working?
Here is the link that would help you build ipa that you can share with your coworker.
Or submit your build on iTunes connect and share it via test flight.
And one more thing you should keep in mind that as you mentioned that this app supports push notifications, i hope you have placed development or production SSL certificate on server which is necessary to send notifications from serve to device.
I recently implemented in an app Push Notifications. We also use an instance of Xcode Server to make automated builds for our QA.
When I updated the app id to support push notifications, I regenerated the provisioning profiles for both development and production.
I also enforced in the build settings to use the regenerated Dev prov. profile for debug builds and the Prod prov. profile for release builds.
But after this, the server didn't succeed to sign the archive anymore because for some reason, the server automatically creates a Team provisioning profile. I tried to force it somehow. I also tried to move prov. profiles in the folder where the server stores them. I also tried exporting/importing private keys. No success. I changed the build settings and went back to "automatic" rather than forcing a provisioning profile.
When I install a build from my local machine it signs with the manual prov. profile. And push notifications work.
If I install a build made with the server, it doesn't work. In the console here's the message:
SpringBoard[53] : No valid 'aps-environment' entitlement
string found for application 'myApp': (null). Notifications will not
be delivered.
When I take a look in the Apple Developer account, the provisioning profile used by the server says that IT HAS push notifications enabled. I can't edit it because it's managed by Xcode.
What to do?
Are you sure you updated also on server side the Certs? Looks like "current Provisioning Profile does not contain APNS information, as the Provisioning Profile is created BEFORE creating the APNS certificate." see here No valid 'aps-environment' entitlement string found for application on app store
Hey Apple developers,
I'm pulling my hair out trying to figure out how iOS provisioning profiles, certificates and app IDs work with push notifications. I thought I was close to getting this to work, but maybe not.
When I run my app and attempt to register push notifications, I get this error in the console:
2012-06-26 17:52:29.380 Grouped[1732:707] badgeNumber: 0
2012-06-26 17:52:30.089 Grouped[1732:707] [INFO] device is ready
2012-06-26 17:52:32.654 Grouped[1732:707] JSLOG: Registering with APNS via the App Delegate
2012-06-26 17:52:32.655 Grouped[1732:707] Register success callback set
2012-06-26 17:52:32.661 Grouped[1732:707] didFailToRegisterForRemoteNotificationsWithError:Error
Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for
application" UserInfo=0x18a0c0 {NSLocalizedDescription=no valid 'aps-environment'
entitlement string found for application}
I've done several hours of research now and can't figure out what I'm doing wrong.
I've created a new provisioning profile that is linked to my app ID. I can see it on my phone.
Any ideas?
Bonus question: Why on earth is it so complicated to properly provision an iOS app for push notifications?
A couple things to check:
Do you have any other provisioning profiles for this app on your device? I'd delete them.
Does your App ID have push enabled in the provisioning portal?
Are you sure you're signing with the correct profile? It has to be a non-wildcard development certificate.
Are you specifying your own entitlements.plist file? Modern Xcode generates one, so you don't need to do this. Make sure your "Code Signing Entitlements" build setting is empty.
If you haven't already found it, Apple has a good FAQ about this:
http://developer.apple.com/library/ios/#technotes/tn2265/_index.html
"no valid 'aps-environment' entitlement string found for
application"
Your provision profile doesn't have push notifications enabled. Make sure you enabled them in the provisioning portal, generate a new profile, but more importantly make sure you actually installed it in Xcode and are signing your app with that profile. That last part has bitten me a couple times.
Be sure to create new adhoc/appstore profiles AFTER you created push certificates for your app. The distribution profiles change after enabling the App for push messages.