Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS - Inconsistency in FCM token #637

Closed
5 tasks done
fgarcia5 opened this issue Jun 30, 2021 · 4 comments
Closed
5 tasks done

iOS - Inconsistency in FCM token #637

fgarcia5 opened this issue Jun 30, 2021 · 4 comments
Labels
bug Something isn't working properly Cloud Messaging Related to Firebase FCM / Push Notifications / APNS ios relates to iOS platform runtime issue An issue related to app runtime

Comments

@fgarcia5
Copy link

fgarcia5 commented Jun 30, 2021

Bug report

CHECKLIST

  • I have read the issue reporting guidelines
  • I confirm this is a suspected bug or issue that will affect other users
  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
  • I have read the documentation thoroughly and it does not help solve my issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

The plugin works correctly but there is an inconsistency when generating the FCM token.

If I try to send a notification to the token generated by "window.FirebasePlugin.onTokenRefresh" the notification never arrives.

If I send a notification to all iOS devices (from Firebase) these doesn't arrive.

Instead, if I take from the XCode console the token generated by
"didReceiveRegistrationToken" and I send the notification it arrives correctly. Also, the token generated by "window.FirebasePlugin.getToken" works.

Before updated the plugin to the v13.0.0, it was working correctly.

Environment information

  • Cordova CLI version
    • cordova -v 10.0.0
  • Cordova platform version
    • cordova platform ls
      Installed platforms:
      ios 6.2.0
      Available platforms:
      android ^9.0.0
      browser ^6.0.0
      electron ^1.0.0
      osx ^6.0.0
  • Plugins & versions installed in project (including this plugin)
    • cordova plugin ls
      cordova-open-native-settings 1.5.5 "Native settings"
      cordova-plugin-app-version 0.1.12 "AppVersion"
      cordova-plugin-appavailability 0.4.2 "AppAvailability"
      cordova-plugin-calendar 5.1.5 "Calendar"
      cordova-plugin-device 2.0.3 "Device"
      cordova-plugin-firebasex 13.0.0 "Google Firebase Plugin"
      cordova-plugin-geolocation 4.1.0 "Geolocation"
      cordova-plugin-inappbrowser 5.0.0 "InAppBrowser"
      cordova-plugin-network-information 3.0.0 "Network Information"
      cordova-plugin-screen-orientation 3.0.2 "Screen Orientation"
      cordova-plugin-statusbar 2.4.3 "StatusBar"
      cordova-plugin-vibration 3.1.1 "Vibration"
      cordova-plugin-whitelist 1.3.4 "Whitelist"
      cordova-plugin-x-socialsharing 6.0.3 "SocialSharing"
      cordova.plugins.diagnostic 6.0.3 "Diagnostic"
      es6-promise-plugin 4.2.2 "Promise"
  • Dev machine OS and version, e.g.
    • OSX
      • sw_vers
        ProductName: Mac OS X
        ProductVersion: 10.15.7
        BuildVersion: 19H2

Runtime issue

  • Device details
  • iPhone 5S (iOS 12.5.3)
  • iPhone 7 Plus (iOS 14.6)

iOS build issue:

  • Node JS version
    • node -v v12.18.3
  • XCode version: 12.4 (12D4e)


How can we fix that?

Thank you for your great work!

@fgarcia5
Copy link
Author

fgarcia5 commented Jul 1, 2021

"onTokenRefresh" works well on v12.1.0

@mctdev-marius
Copy link

mctdev-marius commented Jul 11, 2021

Same Here, on IOS the onTokenRefresh a strange formatted token.
If i send massive Cloud message for all i do get the notification but if i try and use the token got from onTokenRefresh it dose not work, if on the other hand i try the getToken token then all worked.

It all works grate on Android Device, afther the update and remove of deprecations like in this commit for android.

Plugin version 13.0.0

@cellicom
Copy link

Same Here.
Resolved using getToken instead onTokenRefresh, only for iOS.

@mctdev-marius
Copy link

this is not a solution. The IOS has to get the update Android did and use the new firebase apis. This way unregister token will work as well.

@dpa99c dpa99c added bug Something isn't working properly Cloud Messaging Related to Firebase FCM / Push Notifications / APNS ios relates to iOS platform runtime issue An issue related to app runtime labels Jul 23, 2021
@dpa99c dpa99c closed this as completed in 5a3f907 Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly Cloud Messaging Related to Firebase FCM / Push Notifications / APNS ios relates to iOS platform runtime issue An issue related to app runtime
Projects
None yet
Development

No branches or pull requests

3 participants