APNS not working on AdHoc Distribution Profile on Google App Engine - ios

After push notifications were successfully sent and received using general iOS Development and APNs Development iOS certificates, I created iOS Distribution and APNs Production certificates for AdHoc testing.
At first, i created an iOS Distribution certificate and installed it to the Keychain. Then I created APNs Production certificate, installed it to the Keychain, and uploaded .p12 file to the server. Finally, I created provisioning profile and signed it with an iOS Distribution certificate. But when I created and ipa-file and installed it on device, push notifications are not received.
Device asked for permissions and i got a unique device ID, server side is fine.
Had anyone faced that problem and what guide/tutorial followed?
I followed this article
http://gnuromancer.org/2013/04/21/google-app-engine-apns/

The issue was with Google App Engine server.
ApnsService service = APNS.newService()
.withCert(inputStream, "password").withSandboxDestination()
.withNoErrorDetection().build();
If you are about to create AdHoc or AppStore build, along with different certificate and provisioning profile, the withSandboxDestination() line has to be changed to withProductionDestination().

Related

No valid aps-environment entitlement string found for application for Enterprise app

I am working on a meteor based iOS app. The client has the Enterprise Apple Developer account. I am sharing the app with client by uploading the ipa on my secure server(https) and providing him link to install the app for testing.
I am getting the push notification for development environment but when distributing the app using distribution certificates and provisioning profile I am getting this error in method "didFailToRegisterForRemoteNotificationsWithError".
I have also allowed the app for Push Notifications capability from Xcode.
I am using Xcode 9.3 and installing the app on iPad (9.7-inch) running 11.2.6.
I am extracting the ipa for Enterprise account for In-House distribution.
What I may be missing?
I have also allowed the app for Push Notifications capability from
Xcode.
I am getting the push notification for development environment but
when distributing the app using distribution certificates and
provisioning profile I am getting this error in method
"didFailToRegisterForRemoteNotificationsWithError".
I guess that you have not regenerate a new provisioning profile after you add the push notification capability for the App ID in the developer portal.
https://developer.apple.com/account/ios/profile/
You should double check the certificate and provisioning profile you use to build the app contains push notification capability even when you enabled it in the Xcode.

Device token Changing after exported as ipa

Hi Everybody i'm working with Apple Push Notifications for my app here i'm struggled with Device token issues & not getting Notifications.
i successfully created a .p12 key then i uploaded in Amazon SNS it working good and i'm receiving notifications also.
ISSUE Not getting notifications for exported ipa.
When i run with xcode it giving some device token(ex. xxx1111).after i uninstalled the old one,i exported as ipa,& uploaded in diawi.com then run it in same device it gives some different device token(ex. yyy2222). now i copied that new device token(yyy2222) into Amazon SNS with same .p12 key only, now i'm not getting any notifications.
But i deleted the app installed from diawi.com again i run it from xcode then i send the notifications with old device token(xxx1111) it getting notifications.
what is my mistake? help me pls.
TL;DR You've probably not uploaded the production APN certificate to your APN provider.
If the version of the app you run from Xcode works, but the exported version does not, then maybe you've only set up the development APN certificate in your APN provider. The exported app (be it Ad Hoc or Enterprise) is going to use a production certificate, so your APN certificate should be production too.
If you haven't created the production certificate, go to Certificates, Identifiers & Profiles in the developer portal, click on Production and choose Apple Push Notification service SSL (Sandbox & Production):
p.s. The token should change between development and distribution versions of the app.

Why doesn't Xcode recognize my push certificate?

I've just finished my app, and so I am now getting ready to submit. But I need to change my developer Push certificate to Ad Hoc to test it with a Production Push certificate.
I thought I had it all figured out, but when I build the app, I get the error:
"Failed to get the task for process 2023" (The number changes every time I build.)
I have created my provisioning profile, and I am able to navigate to my Project's Build Settings and set the app to use my Ad Hoc profile. However, when I attempt to set my Code Signing Identity to "Apple Production Services..." all I see is my Distribution Certificate, not the Push Certificate.
What is going wrong?
I found the problem. I actually did have everything done correctly the first time. I just didn't know that I couldn't build on my phone through Xcode using an Ad Hoc provisioning profile.
So I ended up testing it by downloading the Beta via iTunes.
First of all, when you transfer all the Development Certificates to the Production you cant build the project from Xcode.
No one see push certificate in code signing identity.
You only see Either Development certificate or Distribution certificate depending upon the provision profile you have selected. You don't have to worry to choose Push notification certificate in Xcode, coz its managed by Apple once you enabled the push Notification service to the app by enabling it with unique bundle identifier in developer account. https://developer.apple.com (Only you have to give the merged version of that APNS certificate and distribution certificate in .pem format to web developer )
For Adhoc You have to generate Ipa of your project form xcode and install in you mobile through external link like http://www.diawi.com, if you import Ipa into your device from iTunes remote push notification will not arrive.

Submit iOS Push Notification App to app store

I made a simple push notification app and try to submit to app store.
I created two types certificates(iOS distribution and APNs Production iOS).
And I added the APNs Production Certificate to Production SSL certificate of existing my app id(com.push.app). The app id(com.push.app) already has Development SSL Certificate(APNs Development iOS).
And I created a provisioning profile with iOS distribution type certificate and used for build app.
I want to know that my procedure is right or wrong because normally we use APNs Development provisioning profile for develpoing as everybody knows.
Regards
It should work fine. Just verify that you generated distribution certificate with gateway.push.apple.com. Also its always wise to have different app id for developement/distribution locally and while launching app on Appstore.
Once you configure your app to use APNs, Xcode automatically creates
the necessary distribution provisioning profiles when you export your
iOS app for beta testing or submit your app to the store.
Please follow:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ProvisioningDevelopment.html

Unable to test Production Push Notifications through AdHoc

I'm following Parse's Push Notification Tutorial for setting up my Parse app to now be able to send Production push notifications, rather than Development ones, so I can get it ready for the app store. This is covered in section 7.1 in the tutorial.
When I attempt to create an AdHoc provisioning profile, it only works if I create an iOS distribution certificate, when I create an APN production certificate, which is the correct one for this purpose, it shows me this:
If I decide to go ahead and use the iOS distribution certificate from this list instead:
The provisioning profile is successfully created, but again, it's not using the correct certificate for push notifications. Likewise, because I had to use the distribution one to create the profile, I therefore would have to use the certificates .p12 file when connecting my Parse Notification settings to this profile. When I attempt to do this, I unsurprisingly receive the following error:
because I'm uploading the .p12 of an iOS Distribution certificate, and not the APN Production iOS certificate. When I try uploading the .p12 of the APN Production iOS certificate to Parse, it works, but my test iOS device doesn't receive push notifications, because the provisioning profile doesn't use that certificate, as I mentioned earlier.
Am I following the directions incorrectly? Why can't I make a provisioning profile using a Production APN certificate, so that it can work with Parse Push Notifications?
I have never used parse, but you have two exact production certificate.
This is an issue, revoke one of them and try again should work!
the provisioning profile doesn't use that certificate
I think you are misunderstanding what you need to do:
delete the app from your device
Build your app signed with distribution certificate
Install the ad-hoc version of the app on your device
Here is an image to illustrate how the provision profile works:
It's a good idea to check apple docs out
Also very important to check which provisioning profile you have used to sign and build the app.
Turns out my error was forgetting to set the code signing settings in both Project AND Targets.

Resources