tufanv Expert Licensed User Longtime User Feb 8, 2019 #1 Hello I use the following sub to get user token : Code: Copy Private Sub GetToken As String Dim no As NativeObject Dim token As NativeObject = no.Initialize("FIRInstanceID").RunMethod("instanceID", Null).RunMethod("token", Null) If token.IsInitialized Then Return token.AsString Else Return "" End Sub and under fcmconnected I use: .... ... sleep(500) log(gettoken) it returns empty. I can send to topic and device get the msg
Hello I use the following sub to get user token : Code: Copy Private Sub GetToken As String Dim no As NativeObject Dim token As NativeObject = no.Initialize("FIRInstanceID").RunMethod("instanceID", Null).RunMethod("token", Null) If token.IsInitialized Then Return token.AsString Else Return "" End Sub and under fcmconnected I use: .... ... sleep(500) log(gettoken) it returns empty. I can send to topic and device get the msg
tufanv Expert Licensed User Longtime User Feb 8, 2019 #2 This could be due to it only displays when token changes. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2019 #3 Try it with: Code: Copy Dim token As String = "" Do While token = "" Sleep(500) token = GetToken Loop Log(token) Upvote 0
Try it with: Code: Copy Dim token As String = "" Do While token = "" Sleep(500) token = GetToken Loop Log(token)