-
Notifications
You must be signed in to change notification settings - Fork 143
Description
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