Hello;
I used FirebaseNotifications lib. and I used sample code
https://www.b4x.com/android/forum/threads/firebasenotifications-push-messages-firebase-cloud-messaging-fcm.67716/
SERVICE name is FirebaseMessaging
after
I sent with firebase tools on web .
it s like underbelow
And Result is under below. Mycode results and real screen result is not same.
My code is
n.SetInfo("X-"&Message.GetData.Get("title"), "X-xxxx", Main)
but, result is diffrent on device!!!
How can i change message before notifige showing process
I used FirebaseNotifications lib. and I used sample code
https://www.b4x.com/android/forum/threads/firebasenotifications-push-messages-firebase-cloud-messaging-fcm.67716/
SERVICE name is FirebaseMessaging
B4X:
#Region Service Attributes
'#StartAtBoot: False
#StartAtBoot: False
#ExcludeFromLibrary: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private fm As FirebaseMessaging
'https://www.b4x.com/android/forum/threads/firebasenotifications-push-messages-firebase-cloud-messaging-fcm.67716/
End Sub
Sub Service_Create
'This is the program entry point.
'This is a good place to load resources that are not specific to a single activity.
fm.Initialize("fm")
Log("service create")
End Sub
Sub Service_Start (StartingIntent As Intent)
Log("service start")
If StartingIntent.IsInitialized And fm.HandleIntent(StartingIntent) Then Return
End Sub
'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Log("app error")
Return True
End Sub
Sub Service_Destroy
End Sub
Public Sub SubscribeToTopics
Log("sub topics")
fm.SubscribeToTopic("general") 'you can subscribe to more topics
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
Dim n As Notification
n.Initialize
n.Icon = "icon"
'n.SetInfo("X-"&Message.GetData.Get("title"), "X-"&Message.GetData.Get("body"), Main)
n.SetInfo("X-"&Message.GetData.Get("title"), "X-xxxx", Main)
n.Notify(1)
End Sub
after
I sent with firebase tools on web .
it s like underbelow
And Result is under below. Mycode results and real screen result is not same.
My code is
n.SetInfo("X-"&Message.GetData.Get("title"), "X-xxxx", Main)
but, result is diffrent on device!!!
How can i change message before notifige showing process