Hello, could someone explain to me why this code works on some iPhones and not in others?
In foreground it always works perfect (in all iphones), but in background, it only works in some.
Am I doing something wrong?
In those that does not work, the notification is not even visible.
Thanks,
In foreground it always works perfect (in all iphones), but in background, it only works in some.
Am I doing something wrong?
In those that does not work, the notification is not even visible.
Thanks,
B4X:
Private Sub Application_RemoteNotification (Message As Map, CompletionHandler As CompletionHandler)
Dim nm As String = Message.Get("nm")
Dim n As Notification
n.Initialize(DateTime.Now)
Dim no As NativeObject = n
n.PlaySound = True
n.AlertBody = nm
If App.OSVersion >= 8.2 Then
no.SetField("alertTitle", "Alert")
'Custom sound
no.SetField("soundName", "csound.wav")
End If
spp.myPhone.Vibrate
MediaPlayer1.Initialize(File.DirAssets,"csound.mp3","")
MediaPlayer1.Looping=False
MediaPlayer1.Volume=1
MediaPlayer1.Position=0
MediaPlayer1.Play
NativeMe.RunMethod("register", Null)
n.Register
CompletionHandler.Complete
End Sub
Last edited: