This is the example provided to subscribe to one topic...
Would this be proper (example) to subscribe to many?
Thanks
B4X:
Public Sub SubscribeToTopics
fm.SubscribeToTopic( "general") 'you can subscribe to more topics
Log(" subscribe Device Token: "&fm.Token)
End Sub
Would this be proper (example) to subscribe to many?
B4X:
Public Sub SubscribeToManyTopics
Dim lst As List
lst.Initialize
lst.AddAll(Array As String("topic1","topic2","topic3","sometopic"))
For i = 0 To lst.Size-1
fm.SubscribeToTopic( lst.Get(i))
Sleep(500) ' attempt to not over-helm the FCM server by blasting it with subscribe requests
Next
' typically, I would get topic names from a table - but the intent is the same...
End Sub
Thanks