In SDK 28 (Android 9) a very important permission MUST TO BE ADDED to the Manifest. Up to SDK 27 there is no impact if you don't use this permission BUT starting at SDK 28 the Firebase Cloud Messaging WILL NOT WORK and will raise an error.
To avoid this error it's only required to add the follow permission to manifest using B4A manifest editor:
More details can be read at Android Migration Notes: https://developer.android.com/about/versions/pie/android-9.0-migration#tya
As suggested by @JohnCody , You will get the follow error on SDK 28 and Android 9 if you don't use the permission in manifest (when the app in in ForeGround and a Firebase message arrives)
java.lang.RuntimeException: Unable to start service com.comten.nexphone.firebasemessaging@f3fffa5 with Intent { cmp=com.comten.nexphone/.firebasemessaging (has extras) }: java.lang.RuntimeException: java.lang.SecurityException: Permission Denial: startForeground from pid=12936, uid=10085 requires android.permission.FOREGROUND_SERVICE
To avoid this error it's only required to add the follow permission to manifest using B4A manifest editor:
B4X:
AddPermission(android.permission.FOREGROUND_SERVICE)
More details can be read at Android Migration Notes: https://developer.android.com/about/versions/pie/android-9.0-migration#tya
As suggested by @JohnCody , You will get the follow error on SDK 28 and Android 9 if you don't use the permission in manifest (when the app in in ForeGround and a Firebase message arrives)
java.lang.RuntimeException: Unable to start service com.comten.nexphone.firebasemessaging@f3fffa5 with Intent { cmp=com.comten.nexphone/.firebasemessaging (has extras) }: java.lang.RuntimeException: java.lang.SecurityException: Permission Denial: startForeground from pid=12936, uid=10085 requires android.permission.FOREGROUND_SERVICE
Last edited: