my app sends sms, the sending works OK
but I can't trap the event "sms sent"
What am I doing wrong?
thank you!
but I can't trap the event "sms sent"
What am I doing wrong?
thank you!
sens sms:
'in the manifest I have
'AddPermission(android.permission.SEND_SMS)
'AddPermission(android.permission.RECEIVE_SMS)
'AddPermission(android.permission.READ_PHONE_STATE)
' Ok, all the permission programming code here is not pasted, but trust mw it's done and working
' code
Sub Class_Globals
'(cut)
Dim PEsms As PhoneEvents ' per notifica invio SMS
'(cut)
end sub
Private Sub B4XPage_Created (Root1 As B4XView)
'(cut)
PEsms.Initialize("PEsms")
'(cut)
end sub
private Sub btnInvioDiretto_Invia_Click
'THIS WORKS
Dim ps As PhoneSms
ps.Send2(InvioDiretto_NumeroTelefono.Text, InvioDiretto_TestoMessaggio.Text, False, False)
ToastMessageShow ("SMS inviato a " & InvioDiretto_NumeroTelefono.Text, True)
'THIS WORKS, the sms is sent
End Sub
Sub PEsms_SmsDelivered (PhoneNumber As String, Intent As Intent)
' THIS DOESN'T WORK
' this event is NEVER raised
Log("SMS Delivered: PhoneNumber=" & PhoneNumber & ", message_id=" & Intent.GetExtra("message_id"))
ToastMessageShow("SMS INVIATO: " & PhoneNumber, True)
End Sub
Sub PEsms_SmsSentStatus (Success As Boolean, ErrorMessage As String, PhoneNumber As String, Intent As Intent)
' THIS DOESN'T WORK
' this event is NEVER raised
Log("phs_SmsSentStatus: PhoneNumber=" & PhoneNumber & ", Success=" & Success & ", Err=" & ErrorMessage & ", message_id=" & Intent.GetExtra("message_id"))
ToastMessageShow("SMS INVIO: esito=" & Success & " -err=" & ErrorMessage, True)
End Sub
Last edited: