MaikuB/flutter_local_notifications

iOS provisional notification permission not working

Open

#2 235 ouverte le 3 févr. 2024

Voir sur GitHub
 (5 commentaires) (0 réactions) (0 assignés)Dart (1 187 forks)batch import
help wanted

Métriques du dépôt

Stars
 (2 208 stars)
Métriques de merge PR
 (Merge moyen 59m) (4 PRs mergées en 30 j)

Description

Describe the bug Requesting provisional permissions returns false immediatly and does display a system prompt.

To Reproduce

  1. Initialize the plugin using the following ios settings. Note that this call also returns false.
final DarwinInitializationSettings iosSettings =
        const DarwinInitializationSettings(
      requestAlertPermission: false,
      requestSoundPermission: false,
      requestBadgePermission: false,
      requestProvisionalPermission: true,
      requestCriticalPermission: false,
      defaultPresentAlert: false,
      defaultPresentSound: false,
      defaultPresentBadge: false,
      defaultPresentBanner: false,
      defaultPresentList: false,
      onDidReceiveLocalNotification: null,
      notificationCategories: const <DarwinNotificationCategory>[],
    );
  1. Request permission later on using the following API:
requestPermissions(
  sound: false,
  alert: false,
  badge: false,
  provisional: true,
  critical: false,
);
  1. Receive a false response and notifications cannot be scheduled.

Expected behavior Provisional notifications should be granted automatically as described in the docs here.

Maybe related: This line in the code comments mentions needing special approval from Apple to use provisional permissions. But I can't see any references to it at the linked page.

Guide contributeur