AlpVir Well-Known Member Licensed User Longtime User Feb 19, 2023 #1 To send an SMS the following code should be valid B4X: Dim Sms1 As PhoneSms Sms1.Send(telnum,txtSMS) or B4X: Dim Sms1 As PhoneSms Sms1.Send2(telnum,txtSMS, False,False) However I get the following error java.lang.SecurityException: Sending SMS message: uid 10214 does not have android.permission.SEND_SMS. Click to expand... despite having indicated in Manifest AddPermission(android.permission.SEND_SMS) Click to expand... and also having used the sub B4X: Sub CheckPermissions As ResumableSub For Each per In Array(rp.PERMISSION_READ_CONTACTS ,rp.PERMISSION_ACCESS_FINE_LOCATION, rp.PERMISSION_WRITE_EXTERNAL_STORAGE, rp.PERMISSION_SEND_SMS) rp.CheckAndRequest(per) Wait For Activity_PermissionResult (permission As String, Result As Boolean) If Result = False Then Return False Next Return True End Sub Where am I wrong ? Thanks in advance
To send an SMS the following code should be valid B4X: Dim Sms1 As PhoneSms Sms1.Send(telnum,txtSMS) or B4X: Dim Sms1 As PhoneSms Sms1.Send2(telnum,txtSMS, False,False) However I get the following error java.lang.SecurityException: Sending SMS message: uid 10214 does not have android.permission.SEND_SMS. Click to expand... despite having indicated in Manifest AddPermission(android.permission.SEND_SMS) Click to expand... and also having used the sub B4X: Sub CheckPermissions As ResumableSub For Each per In Array(rp.PERMISSION_READ_CONTACTS ,rp.PERMISSION_ACCESS_FINE_LOCATION, rp.PERMISSION_WRITE_EXTERNAL_STORAGE, rp.PERMISSION_SEND_SMS) rp.CheckAndRequest(per) Wait For Activity_PermissionResult (permission As String, Result As Boolean) If Result = False Then Return False Next Return True End Sub Where am I wrong ? Thanks in advance
agraham Expert Licensed User Longtime User Feb 19, 2023 #2 Forum search still works! SMS and CALL_LOG permissions are no longer available Google has changed their policy regarding the following permissions: READ_SMS, SEND_SMS, WRITE_SMS, RECEIVE_SMS READ_CALL_LOG, WRITE_CALL_LOG, PROCESS_OUTGOING_CALLS Only the default phone or messaging apps can use these permissions... www.b4x.com Upvote 0
Forum search still works! SMS and CALL_LOG permissions are no longer available Google has changed their policy regarding the following permissions: READ_SMS, SEND_SMS, WRITE_SMS, RECEIVE_SMS READ_CALL_LOG, WRITE_CALL_LOG, PROCESS_OUTGOING_CALLS Only the default phone or messaging apps can use these permissions... www.b4x.com
AlpVir Well-Known Member Licensed User Longtime User Feb 19, 2023 #3 I had certainly read what was described in Erel's post, but, being this post from 2018, I believed that a remedy for this limitation had been found in the meantime. So, if I understand correctly, there is no other way to send an SMS from B4A than using an intent. Nor is there probably the possibility to check immediately whether the SMS has been sent or not. When sending emails with the SMTPExtras library vice versa you can use the sub Sub SMTPExtras1_MessageSent2(Success As Boolean, Tag As Object) and check if the sending was successful. Very comfortable and effective. That of Google is therefore, in my opinion, a great limitation. Upvote 0
I had certainly read what was described in Erel's post, but, being this post from 2018, I believed that a remedy for this limitation had been found in the meantime. So, if I understand correctly, there is no other way to send an SMS from B4A than using an intent. Nor is there probably the possibility to check immediately whether the SMS has been sent or not. When sending emails with the SMTPExtras library vice versa you can use the sub Sub SMTPExtras1_MessageSent2(Success As Boolean, Tag As Object) and check if the sending was successful. Very comfortable and effective. That of Google is therefore, in my opinion, a great limitation.