If I use Erel's rather fine code to send an SMS from my app:
I get a popup that says something like 'Application (my app name) is requesting permission to send SMS messages. This is considered risky. Allow application permission?
Then there are two buttons, Allow and Deny and the Deny button has a countdown from 10 to zero in seconds.
There is also a radio button on the message that says 'don't ask'
If I check that radio button, how would I 'uncheck' it later?
:sign0163:
B4X:
Sub SendSms(PhoneNumber As String, Text As String)
' if smssendallow = true then 'give the option to deny sms text sending in the settings.
Try
Dim ps As PhoneSms
Dim r As Reflector
r.Target = r.RunStaticMethod("android.telephony.SmsManager", "getDefault", Null, Null)
r.RunMethod4("sendTextMessage", Array As Object(PhoneNumber, Null, Text, Null, Null), _
Array As String("java.lang.String", "java.lang.String", "java.lang.String", _
"android.app.PendingIntent", "android.app.PendingIntent"))
ToastMessageShow("Sent SMS Text to " & PhoneNumber, False)
Catch
Log("Failed to send SMS to " & PhoneNumber)
End Try
End Sub
Then there are two buttons, Allow and Deny and the Deny button has a countdown from 10 to zero in seconds.
There is also a radio button on the message that says 'don't ask'
If I check that radio button, how would I 'uncheck' it later?
:sign0163: