Hi,
I'm creating a notification using Firebase Messaging but apparently this error is coming after i send message to app.
Also i already add this to manifest
-Google Play Services Base
-Firebase Base
-Firebase Notifications
after i sent the message in firebase console or in PHP url, the application is crushing "Unfortunately, Test has stopped"
Please help and advise thanks alot
and this is my code
I'm creating a notification using Firebase Messaging but apparently this error is coming after i send message to app.
Also i already add this to manifest
-Google Play Services Base
-Firebase Base
-Firebase Notifications
after i sent the message in firebase console or in PHP url, the application is crushing "Unfortunately, Test has stopped"
Please help and advise thanks alot
and this is my code
B4X:
#Region Project Attributes
#ApplicationLabel: Test
#VersionCode: 1
#VersionName:
#additionaljar: com.android.support:support-v4
#BridgeLogger: true
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Public fm As FirebaseMessaging
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Service_Create
fm.Initialize("fm")
CallSubDelayed(fm, "SubscribeToTopics")
End Sub
Public Sub SubscribeToTopics
fm.SubscribeToTopic("general") 'you can subscribe to more topics
End Sub
Sub Service_Start (StartingIntent As Intent)
If StartingIntent.IsInitialized And fm.HandleIntent(StartingIntent) Then Return
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
'Log("Message arrived")
'Log($"Message data: ${Message.GetData}"$)
Dim nb As NotificationBuilder
nb.initialize
nb.SmallIcon = "icon"
nb.Ticker = "Ticker"
nb.ContentTitle = "Title"
nb.ContentText = "Text"
nb.ContentInfo = "Info"
nb.SubText = "SubText"
nb.OnGoingEvent = True
nb.Notify(1)
End Sub
Sub Service_Destroy
End Sub