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

Do we need to ask the user for "send you notifications" permissions? #162

Closed
inetic opened this issue Jan 3, 2023 · 2 comments
Closed

Comments

@inetic
Copy link
Member

inetic commented Jan 3, 2023

This seem to be happening only with recent android versions. I have a hunch this should be needed only if we wanted to show the user notification messages and not necessarily to show that the application is running in the background (background service icon).

So we need to investigate where this request is coming from and try to remove it. Also, if it is indeed required, what happens when the user presses "Don't allow"?

@J-Pabon
Copy link
Collaborator

J-Pabon commented Jan 25, 2023

It is correct that it happens only on recent versions.

It also seems to be true we don't really need to display the notification -tho I believe it is good to do it, so the user is aware the app is running in the background.

On a Pixel 5, Android 13:

  • Right after installing the app, the notification telling the user the permissions that will be ask for and how they are needed, the initialization fails:

hasPermissions = await FlutterBackground.initialize(androidConfig: config);

  • On the second run (the app was closed and re-opened), the initialization succeeds, while at the same time, the dialog asking the user for the notifications permission is shown. Regardless of the user answer, the initialization will keep succeeding, and the only difference is the presence or not of the notification.

I am looking into the reason for the delayed operation for the notification permissions and how it is related with the initial failing of the initialization.

@J-Pabon
Copy link
Collaborator

J-Pabon commented Jan 25, 2023

There is an issue in the plugin repository about this problem:
[BUG] FlutterBackground is not initialised after letting app run in background

The workaround found there seems to work for now: JulianAssmann/flutter_background#56 (comment)

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

No branches or pull requests

2 participants