I do it this way (but in the RegisterTopic sub to be sure i have a Token)
B4X:
Sub Service_Create
fm.Initialize("fm")
While fm.Token = ""
Sleep(250)
Loop
Log("Token: "&fm.Token)
end sub
Sometimes it can last a few seconds until the Token is available. Especially in the first run.