Android Question Firebase Notification

Johnson Samuel

Member
Licensed User
Longtime User
1. I could not find b4A Library for firebase notification. Where is this library hiding.?
2. I would like to send individual notification, not group. how this can be done? any working example please...
I am using b4A v7.8
Help will be highly appreciated.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Johnson Samuel

Member
Licensed User
Longtime User
I have purchased the latest b4A v9.5 yesterday.
But there is a problem as below :
Public Sub SubscribeToTopics
Log("SubscribeToTopics")
fm.SubscribeToTopic(Starter.Phone.GetSettings("android_id")) 'you can subscribe to more topics
fm.SubscribeToTopic("general") 'you can subscribe to more topics
CheckToken
End Sub
Error shows unkown member: Phone. Althought the phone library is added.
This problem does not show up in b4A-trial (v9.5).
Can u pl. help.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use [code]code here...[/code] tags when posting code.

fm.SubscribeToTopic(Starter.Phone.GetSettings("android_id")) 'you can subscribe to more topics
Looks like a mistake as this will return a fake and non-unique id on new devices.

Add to Process_Globals of the starter service:
B4X:
Public Phone As Phone

A better solution is to get the push token and use it to send to specific devices.

https://www.b4x.com/android/forum/threads/firebase-store-token.85773/#post-543473
 
Upvote 0

Johnson Samuel

Member
Licensed User
Longtime User
Thanks Erel. I succeeded in sending Firebase notification after a hard workout. I Just wanted to know , how to change the icon image in the notification.?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I Just wanted to know , how to change the icon image in the notification.?
It is better to start a new thread for this question as it is not strictly related to push notifications.

You have two options:
1. Use NB6.
2. Put a readonly image in Objects\res\drawable and change Notification.Icon = "icon" with the new file name (without extension).
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…