Why Push Notifications Is Not Working on Testflight

Push Notifications not working in Testflight

Issue resolved! we didn't properly set up our node environment in the server (needed NODE_ENV=production)

Push Notifications problems iOS TestFlight

You need to add an entitlements file for this. In your case, somehow its not attached with your project when you have enabled push notifications from Capabilities. Please Turn off and turn on Push Notifications option. You may get the entitlements file added automatically in your project.

Sample Image

Update : Is server using the sandbox url or the disribution url ?

TestFlight push notifications not working

I regenerated the cert/profile/.p12 about 3 more times and it finally started working. Not a very satisfying answer, but there you go.

iOS app Push Notification not showing in Beta Tester user's device

You need to replace the Push certificate on your Push API server. APNS Distribution certificate is to be used in your case.

for that,
you need to export that certificates from keychain as a .p12 Or .pem file and add it to server API( API which you are using to send push notification). and you will need to set push notification mode in server API to release mode to get push notification in testflight build.

you can export certificates of push by following steps in this link:
https://medium.com/@ankushaggarwal/generate-apns-certificate-for-ios-push-notifications-85e4a917d522

Flutter - firebase FCM messages not working on Testflight release builds at all

Preface:
the issue was mine.

TL;DR
changed only 1 reference of CubeEnvironment to PRODUCTION.


There are multiple locations to change CubeEnvironment:

  • push_notifications_manager.dart#111
  • push_notifications_manager.dart#111
  • call_manager.dart#111

Suggestion to use, even better to add this in your "CallManagerService"'s init() method:

    bool isProduction = bool.fromEnvironment('dart.vm.product');
parameters.environment = isProduction ? CubeEnvironment.PRODUCTION : CubeEnvironment.DEVELOPMENT;

Debugging (process):
The debugging process (being somewhat unfamiliar with Swift & XCode) could have been better. I considered various provisioning profiles, aps-environment settings, etc.

Since the issue only occurred on Testflight, it made debugging alot more challenging and time consuming as uploading a debug build had its own set of issues

Finally I added a bunch of logging, the one that was crucial was the CB-SDK debug entry (when a notification is received):

[
{
"subscription": {
"id": sub id,
"_id": "insert sub id",
"user_id": cube_user_id,
"bundle_identifier": "insert bundle id",
"client_identification_sequence": "insert client id",
"notification_channel_id": 6,
"udid": "insert-uuid",
"platform_id": 1,
"environment": "development",
"notification_channel": {
"name": "apns_voip"
},
"device": {
"udid": "insert-uuid",
"platform": {
"name": "ios"
}
}
}
}
]

specifically, the following entry.

environment": "development

This is due to APS used 2 different push notification environments, each with its own certificates (certificate is assigned to unique URL's where push notifications can come from). This, aps-environment is set to 'production (see on upload Archive screen right before you start uploading) but I'm receiving development environment notifications - that needed fixing.

Reviewing my code, I finally found the issue (and fix mentioned above).



Related Topics



Leave a reply



Submit