Skip to content

Ask for the notification permission on first launch - #32

Merged
juev merged 1 commit into
mainfrom
31-ask-notification-permission-on-launch
Oct 3, 2026
Merged

juev merged 1 commit into
mainfrom
31-ask-notification-permission-on-launch

Conversation

@juev

@juev juev commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Closes #31

What changes

On Android 13 and newer the main screen asks for the notification permission the first time it opens. Before, the dialog appeared only after a sync error had been recorded, so with working sync it never showed up, and the first background error went without a notification.

The request is still made once. After a denial the app does not ask again on launch; Settings → Sync problem alerts → Turn on repeats the request while Android allows it and otherwise opens the system notification settings. Users who have already seen the dialog are not asked again.

R28 in the spec and the notifications paragraph in the README describe the new moment of the request.

Verification

  • assembleDebug lintDebug testDebugUnitTest connectedDebugAndroidTest pass; 61 instrumented tests on an API 36 emulator.
  • NotificationAccessTest.asksOnLaunchOnlyOnce covers the launch decision.
  • Manual run on the API 36 emulator after pm clear:
    • first launch shows the dialog; Don't allow, then a relaunch shows no dialog; Settings shows Off, Turn on shows the dialog again, Allow switches the state to On;
    • first launch, Allow: the permission is granted and Settings shows On.

Known limitation, not changed here

Closing the first dialog with Back is not a denial for Android, yet the app has already recorded the request. Turn on in Settings then opens the system notification settings instead of the dialog. The same happened before this change.

The permission dialog appeared only after a sync error had been
recorded, so with working sync it never showed up. It also could not
cover the first error: links usually arrive through Share, the error
happens in the background, and the dialog waits until the main screen is
opened again.

The main screen now asks the first time it opens. The request is still
made once; after that Settings repeats it or opens the system
notification settings.

Closes #31
@juev
juev merged commit 4b88676 into main Oct 3, 2026
1 check passed
@juev
juev deleted the 31-ask-notification-permission-on-launch branch October 3, 2026 10:56
@juev juev mentioned this pull request Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ask for the notification permission on first launch

1 participant