iOS Question About B4i notification Alert and Sound

roddy

Member
Licensed User
Longtime User
Receive message from B4J Push server is Okay. (message show in Logs window)
I added a short program on notification sound,but my phone does not respond.
In debug mode is no response yet? or my code is wrong?


B4X:
Private Sub Application_RemoteNotification (Message As Map)
    'Log("Remote notification: " & Message)
    Dim m As Map = Message.Get("aps")
    Dim Data As String
    Data = m.Get("alert")
    Log(Data)
    Dim n As Notification
    n.Initialize(DateTime.Now + 2 * DateTime.TicksPerSecond)
    n.PlaySound = True
    n.AlertBody = Data
    n.Register
End Sub
 

roddy

Member
Licensed User
Longtime User
Sorry,my question is: Why this program has no effect on the phone?

B4X:
...
Log(Data)
    Dim n As Notification
    n.Initialize(DateTime.Now + 2 * DateTime.TicksPerSecond)
    n.PlaySound = True
    n.AlertBody = Data
    n.Register

Update...
The programe is right.
I found the answer.
 
Last edited:
Upvote 0
Top