Android Question Firebase push notification

fishwolf

Well-Known Member
Licensed User
Longtime User
I'm trying push notification with firebase and b4a Ver. 6.0

with filrebase console i can send a push to all devices
or send to single device with token/gcm_id.

can i use a SubscribeToTopic different for each user/devices?

I'm trying to figure out if I can avoid to store gcm_ic/token into my server
and use a unique attribute for my user,
for example the email and send push to all devices that uses.

Thanks
 

KMatle

Expert
Licensed User
Longtime User
With one account (mail address) you can log in to x devices so FCM doesn't know which one you mean. This is why the token is needed. It's unique for every device. If you need to simplify it by "send a message to Mike" you need to build a reference in a table like you've mentioned.

I have one app where the users need to give a unique nickname to solve the issue with "one user - one mail adrress - 3 devices".
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
With one account (mail address) you can log in to x devices so FCM doesn't know which one you mean. This is why the token is needed. It's unique for every device. If you need to simplify it by "send a message to Mike" you need to build a reference in a table like you've mentioned.

I have one app where the users need to give a unique nickname to solve the issue with "one user - one mail adrress - 3 devices".

but if i register
1) Mike - device 1 = topic -> [email protected]
2) Mike - device 2 = topic -> [email protected]
3) Mike - device 3 = topic -> [email protected]

can i send a message to Mike using the topic "[email protected]"?
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
To be precise: You can only send Messages to a DEVICE. If you want to use a nickname you Need to map it.


You can send messages

- to the registered devices of a Topic
- to a single device

In your example the message will be sent to all 3 devices (because all subscribed to the same topic)

You can even Register to several topics. The sender decides to which the message is sent to. It's like a Group.
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
i have try it and work fine.

i have used the firebase console for send push

i have notice that with topic opton is not possible send custom fields,
i a limit of console or service?
with firebase api is possible?
 
Upvote 0
Top