Android Question Firebase SubscribeToTopics Starter Service

aaronk

Well-Known Member
Licensed User
Hi,

I am using firebase notifications in my app.

I followed the tutorial and it says the following code needs to be called from the starter service:

B4X:
Sub Service_Create
   CallSubDelayed(FirebaseMessaging, "SubscribeToTopics")
End Sub

Just wondering, does this need to be called every time or just the once ?

In B4i when I subscribe I can just subscribe the once and it is subscribed until I call unsubscribe from the topic.

In my B4A app I have multiple activity's and each page has a button to subscribe to a topic.

Do I need to subscribe to each topic every time my app runs? Or it is automatically subscribed once I call:

B4X:
fm.SubscribeToTopic(topic)

Just trying to work out why I need call SubscribeToTopics when the starter service starts every time.
 
Top