When from the server my app receive Push notification it only show notification but do not bring the UI in front.
Each push notification is incoming call like "ANSWER call or REJECT call" how do i trigger my app UI instead of showing a notification only?
Do i have to send UI interface from the Push server?
Where now its sending notification? Please advise (i am now lost, i want to make ringing UI like whatsAPP answer call or reject call)
Each push notification is incoming call like "ANSWER call or REJECT call" how do i trigger my app UI instead of showing a notification only?
Do i have to send UI interface from the Push server?
Where now its sending notification? Please advise (i am now lost, i want to make ringing UI like whatsAPP answer call or reject call)
B4X:
Private Sub Application_Start (Nav As NavigationController)
NativeMe = Me
NavControl = Nav
App.RegisterUserNotifications(True, True, True)
App.RegisterForRemoteNotifications
End Sub
Private Sub Application_PushToken (Success As Boolean, Token() As Byte)
If Success Then
Log(">>> Token submit")
Dim bc As ByteConverter
myToken = bc.HexFromBytes(Token)
Else
Log("Error getting token: " & LastException)
End If
End Sub
Sub submitToken()
Log(">>> submitToken")
' Token upload
Dim j As HttpJob
j.Initialize("j", Me)
j.PostString(ServerUrl & "/devicetoken", _
"token=" & myToken & _
"&type=1&userid=" & myUserID & "&username=" & myUsername)
End Sub
Private Sub Application_RemoteNotification (Message As Map)
'Log("Remote notification: " & Message)
Dim m As Map = Message.Get("aps")
Log(m.Get("userid"))
Log(m.Get("username"))
Dim mm As Map = m.Get("alert")
Log(mm.Get("body"))
End Sub