Android Question [SOLVED] Is it necessary add SetServiceAttribute ... foregroundServiceType, shortService on Starter Service?

scsjc

Well-Known Member
Licensed User
Longtime User
Is it necessary to put foregroundServiceType - shortService in a Starter Service?

B4X:
SetServiceAttribute(Starter, android:foregroundServiceType, shortService)

is necesary add SERVICE_TIMEOUT?
What value should be used for NotificationID?

B4X:
'This is only needed if you have declared the foreground service type to be shortService!
Private Sub Service_Timeout(Params As Map)
    Service.StopForeground(NotificationId)
End Sub
 
Last edited:

scsjc

Well-Known Member
Licensed User
Longtime User
Hello Alessandro, good afternoon.
Well, I'm in the same situation as you; my English is really bad, and I end up using translators that sometimes confuse me quite a bit.

So, from what I've read, it's unnecessary to add this attribute, so there's no need to use service_timeout either :)

If that's not the case, please let me know. Thanks a lot.
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
I put the attribute, because I have a error in the firebase crashlytics

starter.handleStart
android.app.MissingForegroundServiceTypeException - Starting FGS without a type callerApp

B4X:
SetServiceAttribute(Starter, android:foregroundServiceType, shortService)
 
Upvote 0

ppgirl

Member
Licensed User
Longtime User
I put the attribute, because I have a error in the firebase crashlytics

starter.handleStart
android.app.MissingForegroundServiceTypeException - Starting FGS without a type callerApp

B4X:
SetServiceAttribute(Starter, android:foregroundServiceType, shortService)
Hi Scsjc,

I met same issue in Google Play console, Some Oppo, iQOO and Redmi Android 14 devices have the issue.

Could you update your result after using the attribute? Thanks!
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
Hi Scsjc,

I met same issue in Google Play console, Some Oppo, iQOO and Redmi Android 14 devices have the issue.

Could you update your result after using the attribute? Thanks!
I friend, i fix the problem using:
B4X:
SetServiceAttribute(Starter, android:foregroundServiceType, shortService)
(I have not received any more errors)
 
Upvote 0
Top