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

🐛 [firebase_messaging] onIosSettingsRegistered stream is not updated #3478

Closed
verscph opened this issue Sep 7, 2020 · 2 comments · Fixed by #4012
Closed

🐛 [firebase_messaging] onIosSettingsRegistered stream is not updated #3478

verscph opened this issue Sep 7, 2020 · 2 comments · Fixed by #4012
Labels
platform: ios Issues / PRs which are specifically for iOS. plugin: messaging type: bug Something isn't working

Comments

@verscph
Copy link

verscph commented Sep 7, 2020

Bug report

Describe the bug
onIosSettingsRegistered stream is not updated when notification settings are changed on iOS.

Steps to reproduce

Steps to reproduce the behavior:

  1. Initialize push notification support
Future initialize() async {
    if (Platform.isIOS) {
      iosSubscription = _fcm.onIosSettingsRegistered.listen((data) async {
        print('Settings: $data');
      });
      _fcm.requestNotificationPermissions(IosNotificationSettings());
    }

    _fcm.configure(
      onMessage: (Map<String, dynamic> message) async {
        print('onMessage $message');
        await _dialogService.showDialog(
          title: 'Notification',
          description: message.toString(),
        );
      },
      onLaunch: (Map<String, dynamic> message) async {
        print('onLaunch $message');
      },
      onResume: (Map<String, dynamic> message) async {
        print('onResume $message');
      },
    );
  }
  1. Launch the app
  2. Click "Allow" to allow push notifications
    Console output:
    flutter: Settings: PushNotificationSettings {sound: true, alert: true, badge: true, provisional: false}
  3. Go to settings and disable notifications
  4. _fcm.onIosSettingsRegistered stream is not updated
    Console output:

Expected behavior

Stream should be updated with new notification settings.

Console output:

flutter: Settings: PushNotificationSettings {sound: false, alert: false, badge: false, provisional: false}

Additional context

Add any other context about the problem here.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
[✓] Flutter (Channel dev, 1.21.0-9.0.pre, on Mac OS X 10.15.6 19G2021, locale en-GB)
    • Flutter version 1.21.0-9.0.pre at /Users/philip.verschueren/Projects/flutter
    • Framework revision 7c6f9dd239 (4 weeks ago), 2020-08-09 10:31:03 -0400
    • Engine revision 6d86e67f04
    • Dart version 2.10.0 (build 2.10.0-4.0.dev 0341576448)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/philip.verschueren/Library/Android/sdk
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.7, Build version 11E801a
    • CocoaPods version 1.9.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 48.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (4 available)
    • Phil's iPhone (mobile) • 00008030-0006215601D2802E            • ios            • iOS 13.6.1
    • iPhone 11 Pro (mobile) • CB5E178B-C2F6-4E9E-9370-6B5426697F5A • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-7 (simulator)
    • Web Server (web)       • web-server                           • web-javascript • Flutter Tools
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 85.0.4183.83

• No issues found!


Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.10.0-4.0.dev.flutter-0341576448
Flutter SDK 1.21.0-9.0.pre
futech_app 1.0.0+5

dependencies:
- async 2.5.0-nullsafety [collection]
- charts_flutter 0.9.0 [charts_common collection flutter intl logging meta]
- cloud_firestore 0.14.0+2 [flutter meta quiver firebase_core firebase_core_platform_interface cloud_firestore_platform_interface cloud_firestore_web]
- connectivity 0.4.9+2 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web]
- cupertino_icons 0.1.3
- date_util 0.1.4
- email_validator 1.0.5
- firebase_auth 0.18.0+1 [meta firebase_core firebase_core_platform_interface firebase_auth_platform_interface firebase_auth_web flutter]
- firebase_core 0.5.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- firebase_messaging 7.0.0 [meta platform flutter firebase_core]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_localizations 0.0.0 [flutter intl characters collection meta path typed_data vector_math]
- get_it 4.0.4 [async meta]
- grouped_list 1.3.1 [flutter]
- intl 0.16.1 [path]
- provider 4.3.2 [flutter nested collection]
- stacked 1.7.6 [flutter provider observable_ish]

dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
- intl_translation 0.17.10+1 [analyzer args dart_style intl path petitparser]

transitive dependencies:
- _fe_analyzer_shared 7.0.0 [meta]
- analyzer 0.39.17 [_fe_analyzer_shared args charcode cli_util collection convert crypto glob html meta package_config path pub_semver source_span watcher yaml]
- args 1.6.0
- boolean_selector 2.1.0-nullsafety [source_span string_scanner]
- characters 1.1.0-nullsafety.2
- charcode 1.2.0-nullsafety
- charts_common 0.9.0 [collection intl logging meta vector_math]
- cli_util 0.2.0 [path]
- clock 1.1.0-nullsafety
- cloud_firestore_platform_interface 2.0.1 [flutter meta collection firebase_core plugin_platform_interface]
- cloud_firestore_web 0.2.0+1 [flutter flutter_web_plugins firebase http_parser meta firebase_core cloud_firestore_platform_interface js]
- collection 1.15.0-nullsafety.2
- connectivity_for_web 0.3.1+2 [connectivity_platform_interface flutter_web_plugins flutter]
- connectivity_macos 0.1.0+4 [flutter]
- connectivity_platform_interface 1.0.6 [flutter meta plugin_platform_interface]
- convert 2.1.1 [charcode typed_data]
- crypto 2.1.5 [collection convert typed_data]
- csslib 0.16.2 [source_span]
- dart_style 1.3.6 [analyzer args path source_span]
- fake_async 1.1.0-nullsafety [clock collection]
- firebase 7.3.0 [http http_parser js]
- firebase_auth_platform_interface 2.0.1 [flutter meta firebase_core plugin_platform_interface]
- firebase_auth_web 0.3.0+1 [flutter flutter_web_plugins firebase meta http_parser intl firebase_core firebase_auth_platform_interface js]
- firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.0 [firebase firebase_core_platform_interface flutter flutter_web_plugins meta js]
- flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math]
- glob 1.2.0 [async collection node_io path pedantic string_scanner]
- html 0.14.0+3 [csslib source_span]
- http 0.12.2 [http_parser path pedantic]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- js 0.6.2
- logging 0.11.4
- matcher 0.12.10-nullsafety [stack_trace]
- meta 1.3.0-nullsafety.2
- nested 0.0.4 [flutter]
- node_interop 1.1.1 [js]
- node_io 1.1.1 [node_interop path]
- observable_ish 2.1.4 [collection]
- package_config 1.9.3 [path charcode]
- path 1.8.0-nullsafety
- pedantic 1.9.2 [meta]
- petitparser 3.1.0 [meta]
- platform 2.2.1
- plugin_platform_interface 1.0.2 [meta]
- pub_semver 1.4.4 [collection]
- quiver 2.1.3 [matcher meta]
- sky_engine 0.0.99
- source_span 1.8.0-nullsafety [charcode collection path term_glyph]
- stack_trace 1.10.0-nullsafety [path]
- stream_channel 2.1.0-nullsafety [async]
- string_scanner 1.1.0-nullsafety [charcode source_span]
- term_glyph 1.2.0-nullsafety
- test_api 0.2.19-nullsafety [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.3.0-nullsafety.2 [collection]
- vector_math 2.1.0-nullsafety.2
- watcher 0.9.7+15 [async path pedantic]
- yaml 2.2.1 [charcode collection string_scanner source_span]


@verscph verscph added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Sep 7, 2020
@TahaTesser TahaTesser removed the Needs Attention This issue needs maintainer attention. label Sep 8, 2020
@TahaTesser
Copy link

I can reproduce the issue on 6.0.16 and 7.0.0 as well

This is only called once and isn't updated when changing settings

flutter: Settings registered: PushNotificationSettings {sound: false, alert: false, badge: false, provisional: false}
flutter doctor -v
[✓] Flutter (Channel dev, 1.22.0-9.0.pre, on Mac OS X 10.15.6 19G2021, locale
    en-GB)
    • Flutter version 1.22.0-9.0.pre at /Users/tahatesser/Code/flutter_dev
    • Framework revision 7a43175198 (10 days ago), 2020-08-28 23:18:04 -0400
    • Engine revision 07e2520d5d
    • Dart version 2.10.0 (build 2.10.0-73.0.dev)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tahatesser/Code/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.7, Build version 11E801a
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.48.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.14.1

[✓] Connected device (4 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios
      • iOS 13.7
    • iPhone 11 (mobile)     • 73130414-6DF8-4E37-B9AF-F81FA0F9068B • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-13-7 (simulator)
    • Web Server (web)       • web-server                           •
      web-javascript • Flutter Tools
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 85.0.4183.83

• No issues found!

@TahaTesser TahaTesser added platform: ios Issues / PRs which are specifically for iOS. plugin: messaging labels Sep 8, 2020
@verscph
Copy link
Author

verscph commented Sep 14, 2020

Any updates on this?

@firebase firebase locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: ios Issues / PRs which are specifically for iOS. plugin: messaging type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants