havesource / cordova-plugin-push

Register and receive push notifications
MIT License
150 stars 283 forks source link

iOS Push Notification (APN) is not working in the Testflight mode. #82

Open stardevrk opened 3 years ago

stardevrk commented 3 years ago

Bug Report

Cordova Push Plugins is working well while app is in the development. But after uploading to the testflight, it is not receiving the notification (APN).

Expected Behaviour

It should work at both of development and release.

Actual Behaviour

It is working while app is in the development. (debug mode + Xcode), But not working with the testflight.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS - 14.2

cordova info Printout

Ionic:

Ionic CLI : 6.12.1 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 5.3.4 @angular-devkit/build-angular : 0.1000.8 @angular-devkit/schematics : 10.0.8 @angular/cli : 10.0.8 @ionic/angular-toolkit : 2.3.3

Cordova:

Cordova CLI : 10.0.0 Cordova Platforms : ios 6.1.1 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 16 other plugins)

Utility:

cordova-res : not installed native-run (update available: 1.3.0) : 1.2.2

System:

Android SDK Tools : 26.1.1 (/Users/devmaster/Library/Android/sdk) ios-deploy : 1.11.3 ios-sim : 8.0.2 NodeJS : v14.15.0 (/usr/local/bin/node) npm : 6.14.8 OS : macOS Catalina Xcode : Xcode 12.2 Build version 12B45b

Heshyo commented 3 years ago

So what you're saying is that when you install the app on your iPhone through XCode, you properly receive the notifications using APN (not using Google Firebase), but as soon as you publish the app on Test Flight, you can't receive the notifications?

On my part I also can't receive push notifications on Test Flight, but I can't test locally as I don't have any iPhone.

When using the simulator, are you able to send it a push notification (see Testing Remote Push Notification in iOS simulator)?

Heshyo commented 3 years ago

@stardevrk Any update on this issue? Were you able to fix the problem?

llunn commented 3 years ago

@Heshyo As of today, notifications work on TestFlight.

@stardevrk Are you swapping out your certificates on your intermediary server for TestFlight builds? TestFlight uses production certificates. You can confirm this at the last step before uploading your build to AppStoreConnect, as seen here:

image
Heshyo commented 3 years ago

@llunn Thanks for testing. Are you using version 2.0.1-dev.0?

Also did you try sending a notification to the simulator (see Testing Remote Push Notification in iOS simulator)?

With this plugin, I don't receive anything in the simulator, but with the FirebaseX plugin, I do receiving the notification.

If it's working for you, then there's probably an issue with my dev environment.

llunn commented 3 years ago

@Heshyo This is using v2.0.0 directly from npm registry.

Package lock info:

"@havesource/cordova-plugin-push": {
            "version": "2.0.0",
            "resolved": "https://registry.npmjs.org/@havesource/cordova-plugin-push/-/cordova-plugin-push-2.0.0.tgz",
            "integrity": "sha512-1FwXucwqpK3wk3VcbrxM1ybjKLpl7pIY8XQ4WF/ejxYgYIbvMwHLWk6UW8j8hR8G/Jo3qJZLnZR7EOxpSCjTxQ==",
            "dev": true
        },

I typically do not use the simulator to avoid having to confirm functionality on the device as well. However, i fired up a iPhone 11 simulator using iOS 14.4 and got this: image

I took a very quick look through the source for this plugin doesn't contain that remote notifications are not supported in the simulator, so that error message is either coming from the simulator itself or some other dependency.

With respect to push notifications, my particular iOS setup is simple and I am using only APNS.

I would try on an actual device. Hope this helps.

Heshyo commented 3 years ago

@llunn Thanks, I'll test again with that version and double check the config.

FYI, real push notifications do not work on the simulator, but you can drag and drop a JSON file containing specific fields onto your simulator to fake receiving a notification.

Heshyo commented 3 years ago

After cleaning the project, removing then adding again the v2.0.0 plugin, the JSON notification appears in the Simulator, and I can receive notifications on real devices (tested with FCM) through TestFlight.