SMS Sent Status Event Never Executes

Mike Maurice

Member
Licensed User
Longtime User
This is the Start Service in the Activity_Create
Then the code in the Service module. When the SMS message has been sent there is no confirmation. So what is the problem? A bug, wrong parameters? I have tried almost every combination I can think of in the way of changes and nothing works. Would like a solution.

The correct solution is at the bottom below the ################# line


StartService(SMSServicing) ' This is the name of the Service Moduel

'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim SmsS As PhoneEvents

End Sub
Sub Service_Create

SmsS.Initialize("SMsS_SmsSentStatus") ' I have also tried just "SmsSentStatus" as the string.
End Sub

Sub Service_Start (StartingIntent As Intent)

End Sub

Sub Service_Destroy

End Sub
Sub SmsS_SmsDelivered(Ph As String) ', Intent As Intent)
ToastMessageShow("SMS Delivered", True)
End Sub

Sub SmsS_SmsSentStatus(Success As Boolean, ErrorMessage As String, PhoneNumber As String)
ToastMessageShow("SUCCESS", True)
' If(Success) Then
' ToastMessageShow("Sent SMS Message", True)
' Else
' ToastMessageShow("Failed to Send SMS Message", True)
' End If

End Sub

##########################

'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim SmsS As PhoneEvents
End Sub
Sub Service_Create
SmsS.Initialize("SmsS")
End Sub

Sub Service_Start (StartingIntent As Intent)

End Sub

Sub Service_Destroy

End Sub
Sub SmsS_SmsDelivered(Ph As String) ', Intent As Intent)
ToastMessageShow("SMS Delivered", True)
End Sub
Sub SmsS_SmsSentStatus(Success As Boolean, ErrorMessage As String, PhoneNumber As String, Intent As Intent) As Boolean

If(Success) Then
ToastMessageShow("Sent SMS Message", True)
Else
ToastMessageShow("Failed to Send SMS Message", True)
End If

End Sub
'http://www.b4x.com/forum/basic4android-updates-questions/13605-sms-send-without-notification-message-2.html#post100173
 
Last edited:
Top