MaikuB / MaikuB/flutter_local_notifications

iOS provisional notification permission not working

Open
#2,235 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Dart
Stars
2.7k
Forks
1.6k
Avg merge
4d 8h
Merged PRs (30d)
4

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 [],
);
```

2. Request permission later on using the following API:

```
requestPermissions(
sound: false,
alert: false,
badge: false,
provisional: true,
critical: false,
);
```

3. Receive a false response and notifications cannot be scheduled.

**Expected behavior**
Provisional notifications should be granted automatically as described in the docs [here](https://developer.apple.com/documentation/usernotifications/asking_permission_to_use_notifications#3544375).

Maybe related: This [line](https://github.com/MaikuB/flutter_local_notifications/blob/2783939a3d678d9040b950f44e0e832dcd7ae5a8/flutter_local_notifications/lib/src/platform_specifics/darwin/initialization_settings.dart#L40) 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with flutter_local_notifications/lib/src/platform_specifics/darwin/initialization_settings.dart and trace the requestPermissions API for the provisional option on iOS. Compare the initialization and later permission-request paths with Apple's provisional notification behavior; done means both calls return the expected permission result and notifications can be scheduled without an unexpected system prompt.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter, ios
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.