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

2 Taskhandler with different permission, Causing crash #318

Open
GaneshPokaleFittr opened this issue Feb 10, 2025 · 0 comments
Open

2 Taskhandler with different permission, Causing crash #318

GaneshPokaleFittr opened this issue Feb 10, 2025 · 0 comments

Comments

@GaneshPokaleFittr
Copy link

GaneshPokaleFittr commented Feb 10, 2025

I have 2 Different services, One is used for "location", and another is using for "datasync"

<service android:name="com.pravera.flutter_foreground_task.service.ForegroundService" android:foregroundServiceType="location|dataSync" android:exported="false" />

I have given all required permission but(Location all the time), But when GPS is off and I execute "datasync" task through FCM, the App crashes

"java.lang.RuntimeException: Unable to start service com.pravera.flutter_foreground_task.service.ForegroundService@ff60998 with Intent { cmp=com.my.package/com.pravera.flutter_foreground_task.service.ForegroundService }: java.lang.SecurityException: Starting FGS with type location callerApp=ProcessRecord{1ff29bc 26798:com.my.package/u0a546} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_LOCATION] any of the permissions allOf=false [android.permission.ACCESS_COARSE_LOCATION, android.permission.ACCESS_FINE_LOCATION] and the app must be in the eligible state/exemptions to access the foreground only permission

How to handle this type of situation, there must need one way to define foreground service type at runtime for specific taskhandler

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

1 participant