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

Turn off/on receive notification #147

Closed
Jassmin586 opened this issue Sep 19, 2019 · 1 comment
Closed

Turn off/on receive notification #147

Jassmin586 opened this issue Sep 19, 2019 · 1 comment
Labels
feature request New feature request Firebase SDK Relates to the Firebase SDK library which this plugin wraps legacy Related to inherited code/functionality runtime issue An issue related to app runtime

Comments

@Jassmin586
Copy link

Current behavior:
I try to turn off receive notifications by using window.FirebasePlugin.unregister() but nothing change. Notifications still show on device (check on Android).

Expected behavior:
Can manage receiving notifications in Android/IOS app. Is it possible?

Environment information

  • Cordova CLI version

    • 9.0.0
  • Cordova platform version

    • android 8.0.0
      browser 6.0.0
      ios 5.0.1
  • Plugins & versions installed in project (including this plugin)

    • cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
      cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
      cordova-plugin-facebook4 6.0.0 "Facebook Connect"
      cordova-plugin-firebasex 6.0.7 "Google Firebase Plugin"
      cordova-plugin-geolocation 4.0.2 "Geolocation"
      cordova-plugin-network-information 2.0.2 "Network Information"
      cordova-plugin-splashscreen 5.0.3 "Splashscreen"
      cordova-plugin-statusbar 2.4.3 "StatusBar"
      cordova-plugin-whitelist 1.3.4 "Whitelist"
      cordova-plugin-x-socialsharing 5.4.7 "SocialSharing"
      es6-promise-plugin 4.2.2 "Promise"
  • Dev machine OS and version, e.g.

    • Linux mint

Runtime issue

  • Device details
    • Nexus 5

Android build issue:

  • Node JS version
    • v12.4.0
  • Gradle version
    • 4.10
  • Target Android SDK version
    • 28
@dpa99c
Copy link
Owner

dpa99c commented Oct 22, 2019

When you call unregister(), it deletes the existing FCM token.
By default, the Firebase SDK will then generate a new one.
In order to prevent this - i.e. so you can completely unsubscribe from all notifications - I've exposed the autoinit API functions of the Firebase SDK in the above commit, which allows you to disable autoinit and so prevent a new FCM token being created.

This will be merged to master and pushed out in the next release.

@dpa99c dpa99c added feature request New feature request Firebase SDK Relates to the Firebase SDK library which this plugin wraps legacy Related to inherited code/functionality runtime issue An issue related to app runtime labels Oct 22, 2019
@dpa99c dpa99c closed this as completed in f7a8847 Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request Firebase SDK Relates to the Firebase SDK library which this plugin wraps legacy Related to inherited code/functionality runtime issue An issue related to app runtime
Projects
None yet
Development

No branches or pull requests

2 participants