Hello
I am trying to get individual push tokens to send individual meessages. I am using production ssl with adhoc to have same tokens during production and development. I use the code :
this returns these :
token returns 1 ( success ) but there is an error null below that and pushtoken comes null. What am i doing wrong here ?
edit: I moved the log(gettoken) code to fmc_connected as Erel advised but getting empty string still.
I am trying to get individual push tokens to send individual meessages. I am using production ssl with adhoc to have same tokens during production and development. I use the code :
B4X:
Private Sub Application_Active
fm.FCMConnect 'should be called from Application_Active
End Sub
Sub Application_PushToken (Success As Boolean, Token() As Byte)
Log($"PushToken: ${Success}"$)
Log("Token:" & GetToken)
Log(LastException)
End Sub
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
this returns these :
B4X:
Application_Start
Configuring the default app.
User id: CSOSZFLJI
Test device id: F09FCCFD-7732-4C20-B7FA-896C303C3F2B
Application_Active
FCMConnected
Application_Pushtoken
PushToken: 1
Token:
<B4IExceptionWrapper: (null)>
Application_Pushtoken
PushToken: 1
Token:
<B4IExceptionWrapper: (null)>
token returns 1 ( success ) but there is an error null below that and pushtoken comes null. What am i doing wrong here ?
edit: I moved the log(gettoken) code to fmc_connected as Erel advised but getting empty string still.
Last edited: