iOS Question Application_PushToken & getToken()

fbritop

Active Member
Licensed User
Longtime User
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:
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:
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
 
Top