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

Cannot check for permissions in background using background_fetch #269

Closed
2 tasks done
mootw opened this issue Apr 19, 2020 · 5 comments
Closed
2 tasks done

Cannot check for permissions in background using background_fetch #269

mootw opened this issue Apr 19, 2020 · 5 comments
Labels
status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue. type: bug Something isn't working

Comments

@mootw
Copy link

mootw commented Apr 19, 2020

🔙 Regression

Plugin no longer works in the background.

Old (and correct) behavior

I was able to check for permissions in the background using background_fetch.

Current behavior

It crashes with this stack trace:

04-19 13:05:32.195 18500 18500 D permissions_handler: Activity cannot be null. 04-19 13:05:32.338 18500 19258 E flutter : [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(PermissionHandler.PermissionManager, Android activity is required to check for permissions and cannot be null., null) 04-19 13:05:32.338 18500 19258 E flutter : #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7) 04-19 13:05:32.338 18500 19258 E flutter : #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18) 04-19 13:05:32.338 18500 19258 E flutter : <asynchronous suspension> 04-19 13:05:32.338 18500 19258 E flutter : #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) 04-19 13:05:32.338 18500 19258 E flutter : #3 MethodChannelPermissionHandler.checkPermissionStatus (package:permission_handler_platform_interface/src/method_channel/method_channel_permission_handler.dart:15:41) 04-19 13:05:32.338 18500 19258 E flutter : #4 PermissionActions.status (package:permission_handler/permission_handler.dart:25:51) 04-19 13:05:32.338 18500 19258 E flutter : #5 PermissionCheckShortcuts.isGranted (package:permission_handler/permission_handler.dart:54:33)

Reproduction steps

Use background_fetch plugin to generate a background fetch and check for permissions.
The app has to be force closed for the error to occur. Not just in the background. The activity needs to be null.

Configuration

Version:
4.4.0+hotfix.4 --> 5.0.0+hotfix.3

Platform:

  • 📱 iOS (I do not have a stack trace for iOS but the background functions were not working there either).
  • 🤖 Android
@payam-zahedi
Copy link

I had the same issue.

@Sempakonka Sempakonka added status: triage Indicates that this issue needs to be analyzed and decorated with the appropriate labels type: bug Something isn't working labels Jan 7, 2021
@nmfisher
Copy link

nmfisher commented Apr 8, 2021

My comment here might be helpful:

#334 (comment)

@tomkcook
Copy link

tomkcook commented Dec 5, 2022

I'm seeing the same issue. @nmfisher 's comment identifies the problem well enough, but the details of the fix are well beyond me. Any ideas on how to work around this would be welcome.

@TimHoogstrate
Copy link
Contributor

@mootw,

I suppose this issue is not relevant anymore, Else, please send us some minimal reproducible code or an example project where the error occurs.

Kind regards,

@TimHoogstrate TimHoogstrate added status: needs more info We need more information before we can continue work on this issue. and removed status: triage Indicates that this issue needs to be analyzed and decorated with the appropriate labels labels Aug 24, 2023
@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.

@github-actions github-actions bot added the status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. label Sep 7, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants