Notifications will not work properly with B4A v7.8 as it will not handle the requirements added in Android 8+. See the targetSdkVersion tutorial for more information.
The app will crash on Android 8+ devices when targetSdkVersion is set to 26.
The latest version of the library is attached.
Thanks Erel,
I install new version of firebaseNotifications, and I have sdk 28, but app craches again
My tablet has Android 8.1.
Need new version of B4a?
** Activity (main) Resume **
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
firebasemessaging_subscribetotopics (java line: 253)
java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.zza(java.lang.String)' on a null object reference
at com.google.firebase.messaging.FirebaseMessaging.subscribeToTopic(Unknown Source:15)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at com.mamavi.slimup.firebasemessaging._subscribetotopics(firebasemessaging.java:253)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1135)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7000)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
While you can probably fix this error, once you get it working the app will crash when it receives a message while it is in the background. You must use B4A v8+ with the automatic foreground mode feature.
You DID READ the error?
You DID realized that you need the google-services.json in your projectfolder (as it was needed in the past!) but it is not there?