Hi,
My application cant get push notification .
-Local Mac Builder Server
-iPhoneX on B4i-Bridge
-b4j Sending Tool
FCMConnected fired but there is no token code with below code
Any help ?
My application cant get push notification .
-Local Mac Builder Server
-iPhoneX on B4i-Bridge
-b4j Sending Tool
FCMConnected fired but there is no token code with below code
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 "no"
End Sub
Private Sub fm_FCMConnected
Log("FCMConnected")
'here we can subscribe and unsubscribe from topics
fm.SubscribeToTopic("ios_general") 'add ios_ prefix to all topics
End Sub
Private Sub Application_RemoteNotification (Message As Map, CompletionHandler As CompletionHandler)
'Log($"Message arrived: ${Message}"$)
Msgbox(Message, "Push message!")
CompletionHandler.Complete
End Sub
Private Sub Application_Active
fm.FCMConnect 'should be called from Application_Active
End Sub
Private Sub Application_Background
fm.FCMDisconnect 'should be called from Application_Background
LocManager.Stop
LocManager.StopHeading
End Sub
Sub Application_PushToken (Success As Boolean, Token() As Byte)
Log($"PushToken: ${Success}"$)
Dim bc As ByteConverter
Log(bc.HexFromBytes(Token))
LogColor ("Token:" & GetToken,Colors.blue)
'Log(LastException)
End Sub
Any help ?