Skip to content

[firebase_messaging] Disable Push Notifications permission pop up on iOS startup. #4576

@anilslabs

Description

@anilslabs

Bug report

The Push notification permissions pop up appears while configuration of FCM, It should be controlled by user with "request requestNotificationPermissions().

FCM plugin:
firebase_messaging: ^7.0.3
Flutter version: 1.22.5, channel: stable
Platform : iOS
Testing on: Simulator (iPhone 11 pro), 13.6
`
The push notification permissions dialog should only appear if requestNotificationPermission() is called.

 if (Platform.isIOS) {
  // _firebaseMessaging.requestNotificationPermissions(const IosNotificationSettings(
   //    sound: true, badge: true, alert: true, provisional: false));
   // }



_firebaseMessaging.configure(
   onBackgroundMessage: Platform.isIOS ? null : backgroundAppNtificationHandler,
  onMessage: (Map<String, dynamic> message) async {
   
  },
  onResume: (Map<String, dynamic> message) async {
    
  },
  onLaunch: (Map<String, dynamic> message) async {
  
  },
);

`
Steps to reproduce :

  • Set up FCM example provided with plugin
  • Run flutter packages get`
  • Run on any iOS device/simulator flutter run
  • On start up it will appear the " push notification permission pop up" even if requestNotificationPermission() is not called.
  • Or comment followings code line
    _firebaseMessaging.requestNotificationPermissions(const IosNotificationSettings( sound: true, badge: true, alert: true, provisional: false)); }
  • Uninstall app
  • flutter run (And in start up it will display the push notification permission pop up)

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleIssue with no recent activityblocked: customer-responseWaiting for customer response, e.g. more information was requested.closed-by-botimpact: deprecated-versionThis bug exists only in an older version and is no longer present in later releases.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions