Android Question FCM push notification to a single device

Daniel-White

Active Member
Licensed User
Longtime User
Hi folks, sorry if some one answer it in the forum, but really, I did not find the info.

How to send a single device a Push notification using Firebase. My humble understanding, I shall need the "FCM registration Token"

- How I can know that?
- If I know the FCM registration token, how to send a push notification to that single device.

I am thinking to develop or migrate my APP of B4A to B4I soon, and Iphone does not allow us to manage or handle the SMS arrived. So I will need to use FCM to integrate both Android APP and Iphone. put another layer :eek: to exchange info, Thanks Steve jobs. :confused: I cannot use SMS at all :mad: between Android and Iphone.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You have two options:
1. Create a unique topic for each device.
2. Get the token for each device with FirebaseMessaging.Token and send it to your server.
In this case you set the target with:
B4X:
Dim m As Map = CreateMap("to": Token)
'instead of:
'Dim m As Map = CreateMap("to": $"/topics/${Topic}"$)
 
Upvote 0

Daniel-White

Active Member
Licensed User
Longtime User
You have two options:
1. Create a unique topic for each device.
2. Get the token for each device with FirebaseMessaging.Token and send it to your server.
In this case you set the target with:
B4X:
Dim m As Map = CreateMap("to": Token)
'instead of:
'Dim m As Map = CreateMap("to": $"/topics/${Topic}"$)
o WoW Thanks you Indeed, Erel for the rescue. I very appreciated it.
 
Upvote 0

desof

Well-Known Member
Licensed User
Longtime User
Hello,
Is it happening to me just that I do not understand how to get the token?

And how do I get the Token?
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Upvote 0
Top