iOS Question Syntax for more than one topic / groups of devices

schimanski

Well-Known Member
Licensed User
Longtime User
I have changed my applications to firebase cloud messaging and everything runs perfect. I use the tokens to push single devices. What is the syntax to push more than one devices? I mean a collection of tokens.

B4X:
Dim m As Map = CreateMap("to": $"/topics/${Topic}"$)

related to

Versatile message targeting: Distribute messages to your client app in any of three ways — to single devices, to groups of devices, or to devices subscribed to topics.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
https://firebase.google.com/docs/cloud-messaging/topic-messaging

B4X:
Dim topics As List = Array("Topic1", Topic2", "Topic3")
Dim sb As StringBuilder
sb.Initialize
For Each t As String in Topics
 sb.Append($"'${t}' in topics ||"$)
Next
sb.Remove(sb.Length-3, sb.Length) 'will fail if topics is empty
Dim m As Map = CreateMap("condition": sb.ToString)
 
Upvote 0
Top