Enabling APNs in iOS app after it was created - ios

I am developing an iOS app which uses Push Notifications. I recently uploaded the first version to the App Store and I have turned on the Push Notifications in the Application Services in the app's App ID in Apple Developer Console. It says "Configurable" now. After that I got an email from Apple with a warning:
Missing Push Notification Entitlement - Your app includes an API for
Apple's Push Notification service, but the aps-environment entitlement
is missing from the app's signature. (...)
Then I found out that in XCode, on the Capabilities tab I need to enable Push Notifications. I did it, then created a new version and uploaded it, then I didn't get such a warning. Looks promising so far.
My problem is that I don't quite know where are the certificates for the APNs. I am using Firebase Cloud Messaging which requires to upload a development and a production certificate.
The internet is full of ways to create these certificates manually. Although Apple says always that XCode can do it automagically, which I'd prefer too. I just don't know where those are and whether created or not yet.
In Apple Developer console, I have two certificates created when I uploaded the first version of the app: a development and a distribution certificate. If I click on the APNs Auth Key, there's nothing displayed (not sure if it's a problem)
What do I need to do to automatically generate (or just find if done already) the certificates by XCode?
Any help is really appreciated.

For Push Service you have to create certificates manually and upload them to Firebase Console.

Related

Push notifications works fine in development, but device not getting notification in production

Ok, so I have an app that is in the app store. In development everything works fine I get all of the notifications that I send. I should mention that we are using Firebase for analyics and push notifications as we have a iOS and Android version of the app. Firebase account has both the correct development and correct production apns cert, the app's capabilities are set correctly to include push notifications and remote notifications in the background.
In the organizer window the entitlement for apns-environement is set to production whenever uploading to the app store or when exporting the app. Whenever the app is first installed and ran the alert to allow push notifications is shown. So my apns certs have to be configured correctly.
I am a working on contract for this company, just started 3 months ago, I would hate for these people to look at me in a bad light but I really don't know where the issue is. I am also using Xcode's automatic code signing option, with the correct provisioning profile and developer account signed in the Xcode on this mac.
Just went through this and I do not know if you solved this,
I turned push off and deleted the certs from apple dev center and created them all over again and this made everything work as it should.
I also had this line of code set to,
FIRInstanceID.instanceID().setAPNSToken(deviceToken as Data, type: FIRInstanceIDAPNSTokenType.sandbox)
I will change it to .prod when I push to the app store.

Firebase causes issue "Missing Push Notification Entitlement" after delivery to itunes connect

As you may be aware, Google starts to use Firebase as analytics so I want to use it in my current project. I succesfully finished the implementation and upload project to iTunes Connect. But I got mail below. I do not want to use push notificaiton option of Firebase but its included in SDK. Do I need to remove it?how?
Will it cause to get rejection from review?
Dear developer,
We have discovered one or more issues with your recent delivery for "Instant Baby Dream". Your delivery was successful, but you may wish to correct the following issues in your next delivery:
Missing Push Notification Entitlement - Your app appears to include API used to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement. See "Provisioning and Development" in the Local and Push Notification Programming Guide for more information. If your app does not use the Apple Push Notification service, no action is required. You may remove the API from future submissions to stop this warning. If you use a third-party framework, you may need to contact the developer for information on removing the API.
After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.
Regards,
The App Store team
If the library that you're using has any calls to the push notification API and you don't have a provisioning profile/certificate that enables your app to receive push notifications then you will receive this email from Apple. However if you do not need to use push notifications in your app then you can ignore this email.
This email doesn't mean that your app will be rejected. I used to get this email all of the time when submitting games made with Unity and using a certain Prime31 plugin for native functionality, it also made use of the push notification API which caused me to receive this email.
You can ignore it, it will be fine.
Solution:
Make sure your app does not utilize Firebase Cloud Messaging;
In your Xcode project, select the application target;
Go to Info tab (alternatively, select Info.plist in Project Navigator);
Add FirebaseAppDelegateProxyEnabled and set it to NO;
Go to Capabilities tab and turn ON Push Notifications capabilities;
Re-generate provision profiles.
Objective: While this issue does not mean that your app will be rejected, the email is sent to everyone who has access to the app record on App Store Connect. For corporate team accounts this usually means that management stuff gets this "We have discovered one or more issues" email. For them it usually means that development team does something wrong. Hence, I've been asked to get rid of it.
If you using Firebase, but don't using firebase push notifications, to avoid this warning you should disable app delegate swizzling. Just adding FirebaseAppDelegateProxyEnabled BOOL key with value NO to your Info.plist. And Your future release builds will be without any warnings about Push notifications.

Push Notifications - Subscribed devices w/ tokens using certificates not delivering Push on iOS

Apple no longer provides separate Push Notification SSL certificates for Production and Development Apps.
Which may be causing Push Notification failures to newly submitted apps on the app store using the Appcelerator Platform
Instead Apple now provide the following 2 certificates:
"Apple Push Notification service SSL (Sandbox)" - works in
development
"Apple Push Notification service SSL (Sandbox &
Production)" - works in development But not in Production
Please see the certificates selection on the Apple Developer center
The Certificate's are no longer listed as:
APNs Developement iOS or APNs Production iOS
but NOW instead simply as Apple Push Notification
The new listing of APN certificates
These certificates installed and exported from my keychain as .p12 and uploaded and saved to my Appcelerator Platform as usual.
In Development
Push works as expected
In Production (ad Hoc or App Store Submissions)
Device registers to Push and retrieves a device token.
This is confirmed in the Appcelerator Platform
This is also confirmed on the device's APSD logs which are observed by downloading and installing PersistentConnectionLogging.mobileconfig on the device
This shows:
The device is enabled to receive Push from my bundle ID
The Device receives a device Token
When sending a simple Push Notification using Appcelerator Platform, the Success status is returned for all iOS devices (in test only one used)
However, no push notification is seen on the device (multiple devices tested).
I can see both Parse and Urban Airship have made some changes since Apple's change (Late Dec 2015)
Existing apps seem to have no problem. Only new Production Apps using the new Apple Push Notification Certificate seem to have an issue :(
The app code is working, and correct as Push is successfully delivered in Development for iOS, Android is working too.
I have also deleted and recreated provisioning profiles and push certificates to check configuration.
Anyone else seeing this issue too or am I going mad :)?
First Post here so please be gentle :) I have given my best effort to check for similar questions/answers and to give you guys the most info I can give.. any pointers to better frame the above are most welcome.

Push notification for an app already in the store

I'm fairly new and this was the first time i submitted an app.
So i have an app thats already in the app store. I had push notifications set up and it work when i tested it for the ad hoc distribution using the production certificate.
I did another provisioning profile for the app store and submitted it. Strangely after the app got approved some provisioning profiles disappeared . After being in there for awhile they came back but the push notification setting was turned off even the production ssl certificate for push notif was gone.
Now, Push notifications are not working.
Tried generating another ssl cert and the whole keychain exporting stuffs but it still doesnt work.
I don't know if the app, submitted has the profile with the push notification settings on.
Is it possible to add push notifications to that app? If not what is my best solution here?
No if the App submitted has not been signed with a Push Notifications Profile , then you pretty much can't do any thing about it, You may have to resubmit an entire new Version with a different Provisioning Profile with Push Notifications enabled,
Did you check the server you are trying to connect to when you send the push notifications?
Remember that there are more than 1 server :
ssl://gateway.push.apple.com:2195
ssl://gateway.sandbox.push.apple.com:2195
ssl://feedback.push.apple.com:2196
ssl://feedback.sandbox.push.apple.com:2196
It seems that some migration script went wrong on Apple's server. Your best bet would be to contact Apple support and explain your problem to them. May be they can do something for you.
Even after creating a new push notification certificate you would not be able to enable the push notification for the app already present on app store. Since the certificate is regenerated, you would need to update your profiles too and then use them to prepare a new version for app store.
I think the problem was that the devices that i tried had the app built on them from xcode. Because it worked for other devices that i never used xcode with. After removing all the related provision profile from the device itself, located in the settings menu of the phone, reinstall the app from the store then it started to work.

Will importing SSL certificates for iOS push notifications prevent other developers from working on the project?

I'm implementing push notifications in my iOS app, and as the primary developer, the completed app will be put on my account. However, there is another developer working on this app via GitHub, and he does not currently have access to my apple developer account. (He does, however, have a separate account.)
If I configure the certificates for my branch of the project, and he tries pulling in the changes, will he receive compile errors for not having the certificates? If so, is there a way I can proceed without giving him access to my apple account and its information?
The certificate for push notifications is used server-side and is not part of the application bundle, so it will not have a direct impact on other developers working on the same project (i.e. they can still work on it making builds etc), however for the apns to function there are other considerations besides the push notification certificate.
To configure your app to use apns you will need to set up an app id (this links to a bundle identifier that must be in the applications info.plist). With an app id you can enable the push notification service and get the certificate by submitting a certificate signing request .csr (this can be done with the Key Chain Access application and uses your developer certificate, which links to your developer private key!)
And the final piece of the puzzle is to generate a provisioning profile for the app id (and this is the glue that makes it all work). You must build the application with an appropriate provisioning profile for the service to work.
So to summarise the app id, developer certificate, developer private key, push notification certificate, provisioning profile, and physical devices are all linked together.
The push notification certificate is provided to the push notification server to enable it to authenticate with the Apple servers. It is tied to the bundle ID that you register on the developer account, but it isn't embedded in your source code or your project.
If your other developer is using their own developer account to sign test builds for use on their devices, then their builds will be linked to a different bundle. They will still be able to compile and run code, but they will not be able to push notifications using your notification server. They can generate their own certificates on their own developer account and register this certificate with a push notification service if they want.

Resources