iOS Question Send SMS programmatically

luke2012

Well-Known Member
Licensed User
Longtime User
Hi all,
within an Android App I can use the belove code in order to send a SMS.

What about iOS Apps?

1) Is there a library to do this?
2) The OS allow to send SMS programmatically ?

B4X:
Sub Event_Click
Dim Sms As PhoneSms
Sms.Send2(NumberPhone,Body,False,False)
End Sub
 

Star-Dust

Expert
Licensed User
Longtime User
tru this (use iPhone Library):
B4X:
Private Sub Event_Click
    Dim smsc As MessageComposer
    smsc.Initialize("smsc")
    smsc.SetRecipients(Array As String("123332323")) 'must be strings!
    smsc.Body = "Hello!!!"
    smsc.Show(Page1)
End Sub

Sub smsc_Complete (Result As Int)
    If Result = smsc.RESULT_SENT Then
        hd.ToastMessageShow("Message sent", True)
    Else
        hd.ToastMessageShow("Message was not sent", True)
    End If
End Sub

see this: https://www.b4x.com/android/forum/threads/mails-and-sms-messages.46131/#content
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
If I'm not wrong the only difference with Android is that you can't send SMS silently. With the above code the user must confirm and click "send" in the message application.
 
Upvote 0

BillMeyer

Well-Known Member
Licensed User
Longtime User
You are right - Apple Policy unfortunately.
 
Upvote 0
Top