Renewed Push Notification certificate not working on some devices - ios

Last year i created a push notification certificate and PEM for my app.
In my app, when a user logs in, the device token will be send to server. By default, the apps remains logged in until user logout from the app. Now the push certification expired and i created a new one and generated a new pem file. But when i try to send a push notification to all devices. It fails, but i got a message as "Connected successfully".
I have around 100 users in my app. Old users are not getting any notification. But if i delete my app and re-download. It works. But i don't want the user to delete and install the app again. I have all user's device token in my server . But none of them is working.
I come across this answer. Will it make any difference
https://stackoverflow.com/a/6825777/711963
Note: My app support versions from iOS V5.1.1
Any help is appreciated

Have you tried to create new provisioning profile and creating the PEM file from that ?
Also create the new IPA from new created profile and add all the device token into it .

Related

Notification not received in iOS after I transfer bundle id from apple developer account to another

I use APNs Authentication key to configuration in my firebase.
I do transfer app bundle from developer account to another account.
After transfer, my app in iOS device cannot received notification from firebase.
Is it mean that, my old APNS authentication key is not working? Am I need to create APNs key in my new developer account?
If like that, my existing user that already install my app will not received notification, until I upload new app version?
Keys and certificates are generated per team. If you're using your personal team to publish the app, you need to generate all new certificates and keys after you changes your developer account.
On your backend you should somehow solve the problem of using both keys during transition period: An old one for your old app versions and the new one for the new app, published from another account. Otherwise users who use older app versions won't be receiving your push notifications.
In case of Firebase
In Firebase console you need to create a new app, using new Team ID. In your Apple Developer account you need to create new APNs key and add it to your new app in Firebase. On your backend you need to handle these two applications separately, because they'll have different Firebase keys.
you must add a new project in firebase, because of the new apple developer account and new bundle Identifier, and download new
"GoogleService-Info.plist" file and replace it.
after that, you must define new APNS authentication and add the key to firebase with the new bundle id.
your "Team Id" now changed and you must add or edit your firebase project. check the below pic in last item (this pic is in firebase project settings):

iOS App Transfer + Firebase Cloud Messaging

I recently transferred my iOS app from one developer account to another and now I am not able to send push notifications from Firebase Cloud Messaging to my app. I have tried the following:
Updating the Team ID in the Firebase Console
Generating a new APNs Key and uploading to the Firebase Console
Re-configuring APNs on Apple Developer App ID page for the app of interest
a) Generating a Certificate Signing Request on my local machine
b) Uploading this Certificate to the App ID to configure APNs
c) Generating a new certificate based off of this CSR
d) Downloading this new certificate and saving in keychain
Trying to send push notifications from the Firebase Console
It is clear that the FCM Tokens are updated and that the problem lies within something that I am missing / forgetting to do on the Apple side to allow FCM to talk to APNs, but I cannot figure out what I am doing wrong. Any thoughts?
We've encountered essentially the exact same issue. So far, the only way we've gotten push notifications to deliver to the client is by re-installing the App. Watching this to see if anyone else has a better solution!

Push certificate revoked or expired?

We've used push notifications for the occasional status update (to all users) in our app for a couple of years. Today, we wanted to send another, but nothing happened. When inspecting the certificate, it says it expired november 2nd. Great.
When I go into the developer portal and "Certificates - All", I don't find my certificate anywhere. If I open the AppID to my app, it says "Push Notifications • Configurable", as if it was never configured. Is this correct? I would think it should say "Expired" instead of Configurable, and that the certificate would still exist under "Certificates"?
Is this right, or could it be that someone revoked/deleted my Certificate?
So, my only option now is to click "Configure" push notification in my app's AppID, I guess.
If I remember correctly, it is possible to make this work with existing installed apps (without having to release/update the app), if I create a new certificate the correct way, right? How did that work?
If I click "Configure" and "Create Certificate", I get to the usual "create a CSR then upload it, then download the cert". Is it correct that if I use the same CSR as we used the previous time we created this certificate, get my new certificate, then give it to my server, I will be able to send notifications to existing devices?
You can use the P8 certificate for this type of an expiry issue. Because P8 certificate is a one time certificate and it has no expiry time. Here you can find about the P8 certificatr

iOS - What happens I lost my APNs Key file?

I just created the APNs Key file from Apple Developer website. It was saying "Don't lost this key". I already have a backup but what happens if I lost it?
It is also saying I just need one APNs Key for all apps.
Can I create more than one APNs Key or should I go with just one? If I lost this am I going to can't send notifications for just that app or none of my apps?
Thanks in advance.
You can have MULTIPLE .p8 files. The .p8 file is used to generate a JWT Token on the server side and that is used to send push notifications via HTTP2 to Apple's APNS server. Only problem is that if you lose it, you have to regenerate a new one on the server side. It doesn't affect existing apps at all because it's bound to the bundleId, applicationId, and developer account.
In other words, it's not a certificate that the app has to be re-signed with or anything.
Scenario to make it simpler:
I create an app called MyApp with BundleId: com.SO.myApp.
I create an APNS .p8 file with account RT8NCD.
On the server side, I use this .p8 file to send notifications to com.SO.myApp via HTTP2 and JWT Token generation.
I release the app to the AppStore.
I then LOST the .p8 file and can't send push to my app which is already on the store!
What do I do?
I go into the developer portal and re-create a NEW .p8 file with the same AppId and BundleId and same account.
Then on the server side I use this .p8 file to send push notifications to the devices registered in my database.
I do not need to release a new app or new version or anything.
So in other words, there's not really any consequences to losing it.. but it's not a good idea to get into the practice of losing keys, certificates, etc.. Seriously.
P.S. I cannot guarantee that this behaviour won't change in the future. It's Apple. Try not to lose things.
you can create one APN key per app (one for development one for production) but also you can recreate it, and all devices which was registered with all APN will be supported by new key

After Expire certificate, is it necessary to create a new Pushnotification based provisioning profile at apple

I am using push notification based application with apply all the required information related to a push notification based application.
Now i want to know that after revoke or expiration of the certificate of user, is it necessary to create a new provisioning profile with new push notification enabled profile.
What are the limitations of the push notification based profiles in iOS.
No, you don't have to.
Unless you will update your app, you can continue to do push notifications without renewing any provisioning profiles. All you have to do is renew p12 file that is used at backend side. You can find many tutorials on the web about how to create p12 file for push licenses.
Yes it is, your profile needs to exist AND it needs to be valid for push notifications to be delivered.

Resources