iOS Notifications - my devices receive notifications, testers do not - ios

Please note in advance, I'm new to iOS notifications.
I'm building an iOS app which receives APNS notifications. I've provisioned the app, generated development and deployment certs and handed those to the people developing the CMS which the app consumes data from and which sends the notifications.
When the CMS sends an APNS notification, both my iOS test devices receive it. It seems to work!
I've put the app on Apple's TestFlight service, and when the app is downloaded from TestFlight to the same 2 iOS devices (first deleting the builds installed by Xcode), the notification are received. So that works too.
BUT.
My client has installed the app (same TestFlight build), but they aren't receiving the notifications. So I got a colleague to install TestFlight, and added her to my external testers list to install the app. The app on her iPhone ALSO doesn't receive notifications.
So for some reason, my two devices receive notifications, and as far as I can tell, no other devices do.
I'm in the process of adding tons of alert dialogs in my notification pathways to noisily alert errors.
But in the mean time, does this ring any bells to anybody? Are my two devices somehow "blessed" because I initially installed the app via Xcode?

So it turns out the server side was the issue - when they switched to the production certs, they didn't switch to the production APNS API endpoint.
So, if anybody finds this through google, ad the above to your checklist of things-that-might-have-gone-wrong.

Related

Push notification problems with Back4App and APN Authentication Key

I'm using ParseServer with Back4App for an Android and iOS App. I implemented a Cloud Function on the server to send push notifications through Parse and it works for the Android app without any issues (for both debug and production apks).
With the iOS Version I am currently running into the following problem:
I created an APN Authentication Key that I uploaded to Back4App. In the process I indicated that this key is for a debug app, and sending push notifications via the Cloud Function to my iOS debug device works like a charm, no matter what device triggers the Cloud Function. This was sufficient for development.
I need to be able to get push notifications to both device types to troubleshoot together with my TestFlight testers in an open test I recently started.
For all TestFlight test devices, push notifications are not getting delivered - which is not surprising, given that the APN Key was uploaded to Back4App for debug apps only.
I thus reuploaded the APN Key and indicated that it is a production app, and now sending push notifications to the TestFlight testers works, but sending push notifications to my iOS debug test device does not.
I tried getting around this by changing the build scheme in Xcode from Debug to Release - but with a release version on my iOS debug device, the push notifications are still not being delivered to said device. I can see in my Parse Dashboard that they are being sent, but they are not getting delivered.
I am using a Notification Service Extension and set the Build Mode to Release there as well, but to no effect.
Changing the APN Authentication Key on Back4App back to Debug only allows me to receive push notifications again on my debug device.
I tried changing the APN Authentication Key (for either debug and production, since I cannot select both on Back4App) before force quitting the app, restarting it to get a new APN token saved to the ParseServer, and then sending the test notifications, also to no avail. I tried this for both my debug device and a TestFlight device, and it is always either my debug device (who gets the app straight from Xcode) or the TestFlight devices that are able to receive push notifications, never both.
I did not get around to trying it with APN Certificates for which I read that there are two distinct certificates for Production and Debug apps. While this option would be possible with Back4App, one big question remains - how do you implement push notifications both for debug and production apps in iOS with only one APN Authentication Key? And more specifically, how do you do that on Back4App?
Or are there any other ways around this issue besides the old APN Certificates? Since APN Authentication Keys are made out to be the future I'd rather implement it with that instead of the older APN Certificates.
Any help is appreciated, thanks in advance!
I found a workaround and what caused the issue:
Using APN Authentication Keys for push notifications is easier to implement and more convenient since keys don't expire, can be used across multiple apps and do not require the generation of independent development and production certificates.
But: An APN Authentication Key can only be used for EITHER development push notifications OR production push notifications (which is apparently intended by Apple).
No matter whether build settings are set to Release or Debug, a tethered physical device that gets any build straight from Xcode will always have the APN environment flag set to development - even manually setting the APN environment flag to production before building does not have an effect, it seems to be reset at build time and defaults to development. This means that my debug test device (physically connected to Xcode) can only receive development pushes, which explained my described issues.
When archiving a build and uploading it to TestFlight, the APN environment flag is automatically set to production; all TestFlight testers thus only receive production push notifications.
What I am doing to work around this is that I registered my debug test device as a TestFlight tester so that I can download my latest build from there and take advantage of production pushes. I registered this particular test device as its own group so that I can test builds only with that device that I do not want to immediately roll out to all other TestFlight users in my second (true) group of testers.
Does that mean I always need to archive any new builds and push it to my test device via TestFlight to try something new?
No, only for things that require push notifications. For everything else I still get the latest build straight from Xcode because all locally stored data (like a logged-in Parse User or Installation data) persists on my device, no matter whether I install a new version from Xcode directly or through TestFlight automated updates.
That way I can work as usual and only have to take the additional TestFlight step for any push notification-related features.

Amazon SNS with Firebase iOS

I have integrated AWS SNS with Firebase to send Push Notifications to iOS and Android.
Everything works fine for Android, but iOS is giving me headaches. On my development device (iPhone SE), running in development mode, the notifications are always received. But when the app is installed via App Store (production), the notifications never show up, on any device. Also, after trying to send a push, the SNS Endpoint gets disabled, and for the next attempts to send it, i get the error Endpoint Disabled. I have already checked the certificates and everything seems ok.
App iOS is configured at firebase with the APNS Auth Key (.p8)
Notifications sent via Firebase Message Test are delivered, what makes me think that the problem is not with apple certificates.
The delivery status log says
{ ... error: NotRegistered }
Finally figured out the solution.
I did not know that, after updating the certificates and keys in the app store developer, I had to build a new version of the app for applying these updates.
So, I reviewed all the info related to the certificates and the push notifications. When I was sure that everything was correctly configured, I build the IPA and uploaded it for Test Flight.
Now its working as it should =)

Push Notification (FCM) not working in a test flight mode nor in a downloadable form

I am trying to make my application work with a push notification service in a test flight mode ( essentially in a downloadable form, which is already in the app store ) but has worked in vain.
My IOS application was built with react native framework(0.39v). The application worked fine in the debug/release mode, being able to receive FCM sent from the API server or messages from Firebase console. Thinking it is ok to put the app on the appstore shelf, I uploaded the application and downloaded to my mobile. It worked expected except receiving Push Notification. It turns out that a testflight mode also shows malfunctioning of a push notification service. I am not sure why.
What would be the typical approach to deal with this issue? I reapplied the provisioning profile to the app but ended up failing. What would you recommend me to do? Might have this issue been triggered because of APNs certificate or Push Notification certificate?
If you have had similar issues, please them share with me!

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.

Quickblox sending push notifications to development devices, but not to production devices on iOS

I've been working on an app for a while that uses push notifications from the chat module of QuickBlox.
I've been testing the push notifications on my iPad and it works fine (Developer Device). I've added both of the certificates to QuickBlox and both are active(Developer & Production).
The production devices are being registered for remote notifications and they are showing that they registered for production push notifications. When I send a message to a developer device it receives the notification and it works fine, however when I send to a production device its not received.
If I try to send a push notification to production users from the admin panel it gets sent, but non receive it. The production users are internal and external testers in TestFlight. I heard the TestFlight testers have to use a production certificate so thats why I'm registering them as so. When I archive the build going to the store I make sure that I do it using the production provisioning profile. I don't know what else to do :O
Thanks in advance
edit: I tried using push notification tester for the certificate and it worked fine. It pushed and the push notification was received to the production device. Still not working on QuickBlox
I tried to remove the certificate and then add it again, but that didn't help. I had to revoke my certificate then create a new one. After I added it, it took a good few hours until the notifications started to work. Must have been an issue with QuickBlox.

Resources