fbritop Well-Known Member Licensed User Longtime User May 25, 2021 #1 This is just a question to my own knowledge. What´s the difference between the token returned from Application_PushToken and the Sub GetToken? B4X: Copy Private Sub Application_PushToken(Success As Boolean, Token() As Byte) If Success Then Dim bc As ByteConverter Log(bc.HexFromBytes(Token)) End If End Sub B4X: 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 Both Subs return a different value. On the other hand, why is FirebaseAnalytics requiered in order that GetToken does not crash? Thanks FBP
This is just a question to my own knowledge. What´s the difference between the token returned from Application_PushToken and the Sub GetToken? B4X: Copy Private Sub Application_PushToken(Success As Boolean, Token() As Byte) If Success Then Dim bc As ByteConverter Log(bc.HexFromBytes(Token)) End If End Sub B4X: 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 Both Subs return a different value. On the other hand, why is FirebaseAnalytics requiered in order that GetToken does not crash? Thanks FBP
Erel B4X founder Staff member Licensed User Longtime User May 26, 2021 #2 Application_PushToken - iOS token GetToken - Firebase token fbritop said: On the other hand, why is FirebaseAnalytics requiered in order that GetToken does not crash? Click to expand... FirebaseAnalytics is always required when using Firebase. It is the base library. Upvote 0
Application_PushToken - iOS token GetToken - Firebase token fbritop said: On the other hand, why is FirebaseAnalytics requiered in order that GetToken does not crash? Click to expand... FirebaseAnalytics is always required when using Firebase. It is the base library.