cooperlegend Active Member Licensed User Longtime User Oct 29, 2024 #1 I am getting old and struggling to keep up with recent changes. Please help Google Play is reporting "Missing foreground service type" to me Problem Your app or a library it uses tried to start a foreground service without declaring a service type Recommendation Declare the foreground service type in the manifest file and include it in the startForeground() call My App uses firebase messaging to notify the App to update at various point. I don't under stand what they are referring to (Background/Foreground ?) What do I need to add, trawling though this forums suggests either SetServiceAttribute(Starter, android:foregroundServiceType, shortService) Private Sub Service_Timeout(Params As Map) Service.StopForeground(NotificationId) End Sub or AddPermission(android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING) SetServiceAttribute(Starter, android:foregroundServiceType, "remoteMessaging") The first wont compile as NotificationId is not declared !!?!
I am getting old and struggling to keep up with recent changes. Please help Google Play is reporting "Missing foreground service type" to me Problem Your app or a library it uses tried to start a foreground service without declaring a service type Recommendation Declare the foreground service type in the manifest file and include it in the startForeground() call My App uses firebase messaging to notify the App to update at various point. I don't under stand what they are referring to (Background/Foreground ?) What do I need to add, trawling though this forums suggests either SetServiceAttribute(Starter, android:foregroundServiceType, shortService) Private Sub Service_Timeout(Params As Map) Service.StopForeground(NotificationId) End Sub or AddPermission(android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING) SetServiceAttribute(Starter, android:foregroundServiceType, "remoteMessaging") The first wont compile as NotificationId is not declared !!?!
LucaMs Expert Licensed User Longtime User Oct 29, 2024 #2 Erel said: Assuming that you aren't calling StartForeground yourself, then this warning is probably moot. You can add this declaration to the manifest editor. Click to expand... So the second one. Upvote 0
Erel said: Assuming that you aren't calling StartForeground yourself, then this warning is probably moot. You can add this declaration to the manifest editor. Click to expand... So the second one.
cooperlegend Active Member Licensed User Longtime User Oct 29, 2024 #3 Is this just for firebase messaging or is this something I need to do for syncing data on my App with my server database? Upvote 0
Is this just for firebase messaging or is this something I need to do for syncing data on my App with my server database?
LucaMs Expert Licensed User Longtime User Oct 29, 2024 #4 cooperlegend said: Is this just for firebase messaging or is this something I need to do for syncing data on my App with my server database? Click to expand... For all your apps that use a foreground service. Upvote 0
cooperlegend said: Is this just for firebase messaging or is this something I need to do for syncing data on my App with my server database? Click to expand... For all your apps that use a foreground service.
cooperlegend Active Member Licensed User Longtime User Oct 29, 2024 #5 What is a foreground service ???? All my Apps run in the foreground Upvote 0
LucaMs Expert Licensed User Longtime User Oct 29, 2024 #6 cooperlegend said: What is a foreground service ???? All my Apps run in the foreground Click to expand... It is used by Firebase Messaging. Last edited: Oct 29, 2024 Upvote 0
cooperlegend said: What is a foreground service ???? All my Apps run in the foreground Click to expand... It is used by Firebase Messaging.
cooperlegend Active Member Licensed User Longtime User Oct 29, 2024 #7 SO just firebase messaging, nothing to do with OKHttpUtils2 for data transfers Upvote 0
LucaMs Expert Licensed User Longtime User Oct 29, 2024 #8 cooperlegend said: nothing to do with OKHttpUtils2 for data transfers Click to expand... Nothing. Only if you create a foreground service code module, but since you don't know what they are, it's obvious that you don't. Upvote 0
cooperlegend said: nothing to do with OKHttpUtils2 for data transfers Click to expand... Nothing. Only if you create a foreground service code module, but since you don't know what they are, it's obvious that you don't.
cooperlegend Active Member Licensed User Longtime User Oct 29, 2024 #9 Hence my first statement Thanks for your help. But I still haven't a clue what I need to add. I have several Apps, some use firebase messaging, some use GPS, some use bluetooth. Google Play just states a standard message "Missing foreground service type From Android 14, developers must specify service types when foreground services are found in their app's manifest. A version of your app that is currently in production is crashing because it tries to start a foreground service when no foreground service type is declared. Make sure that service types for the services that start in the foreground are specified in your app's manifest." So simply , I ask , can anyone help me fix this issue. Plain simple help would be much appreciated with an explanation. Thanks Upvote 0
Hence my first statement Thanks for your help. But I still haven't a clue what I need to add. I have several Apps, some use firebase messaging, some use GPS, some use bluetooth. Google Play just states a standard message "Missing foreground service type From Android 14, developers must specify service types when foreground services are found in their app's manifest. A version of your app that is currently in production is crashing because it tries to start a foreground service when no foreground service type is declared. Make sure that service types for the services that start in the foreground are specified in your app's manifest." So simply , I ask , can anyone help me fix this issue. Plain simple help would be much appreciated with an explanation. Thanks
LucaMs Expert Licensed User Longtime User Oct 29, 2024 #10 I'll try one last time (I'm not an expert on this topic). If your app HAS a foreground service (search on site to find out what it is; in short, a service module with a notification), then you must declare in the Manifest file what type of that foreground service is. Since you don't know them, you certainly have never added them to your projects. In this case, however, it is the Firebase Messaging library that has a foreground service, so only in this app of yours you must write in the Manifest File: B4X: AddPermission(android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING) SetServiceAttribute(FirebaseMessaging, android:foregroundServiceType, "remoteMessaging") Upvote 0
I'll try one last time (I'm not an expert on this topic). If your app HAS a foreground service (search on site to find out what it is; in short, a service module with a notification), then you must declare in the Manifest file what type of that foreground service is. Since you don't know them, you certainly have never added them to your projects. In this case, however, it is the Firebase Messaging library that has a foreground service, so only in this app of yours you must write in the Manifest File: B4X: AddPermission(android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING) SetServiceAttribute(FirebaseMessaging, android:foregroundServiceType, "remoteMessaging")
cooperlegend Active Member Licensed User Longtime User Oct 29, 2024 #11 OK, It is starting to make more sense now, thanks So it is the libraries that I am using like firebase, bluetooth, GPS that have foreground notification that it needs informing of ? Wil SetServiceAttribute(Starter, android:foregroundServiceType, shortService) cover all of these rather than having to be specific ? Upvote 0
OK, It is starting to make more sense now, thanks So it is the libraries that I am using like firebase, bluetooth, GPS that have foreground notification that it needs informing of ? Wil SetServiceAttribute(Starter, android:foregroundServiceType, shortService) cover all of these rather than having to be specific ?
drgottjr Expert Licensed User Longtime User Oct 29, 2024 #12 1) SetServiceAttribute() needs to refer to the foreground service(s) causing the problem. 2) the "shortService" attribute may or may not be accepted. it depends on the service(s). Upvote 0
1) SetServiceAttribute() needs to refer to the foreground service(s) causing the problem. 2) the "shortService" attribute may or may not be accepted. it depends on the service(s).
cooperlegend Active Member Licensed User Longtime User Oct 29, 2024 #13 Can I add multiple SetServiceAttributes ? How can I know which libraries are likely causing the Reported errors ? Upvote 0
Can I add multiple SetServiceAttributes ? How can I know which libraries are likely causing the Reported errors ?
drgottjr Expert Licensed User Longtime User Oct 29, 2024 #14 it appears that google is telling you that one of your apps is crashing due to the missing foreground service type exception. that you submitted an app which doesn't run for publication is hard to believe, but if google says it's crashing, it must be crashing. run it yourself and log the crash. Upvote 0
it appears that google is telling you that one of your apps is crashing due to the missing foreground service type exception. that you submitted an app which doesn't run for publication is hard to believe, but if google says it's crashing, it must be crashing. run it yourself and log the crash.
cooperlegend Active Member Licensed User Longtime User Oct 29, 2024 #15 It doesn't crash on any of my android devices. Upvote 0
drgottjr Expert Licensed User Longtime User Oct 29, 2024 #16 have you told google? are all parties talking about the same app? you are allowed to ask for clarifications. Upvote 0
have you told google? are all parties talking about the same app? you are allowed to ask for clarifications.