Hello i made an app that uses some code to call a phone number when i click on it.
Unfortunately this feature blocks the app from being available to tablets without sim. Is there any way to solve this problem?
Unfortunately this feature blocks the app from being available to tablets without sim. Is there any way to solve this problem?
B4X:
Sub DialNumber(PhoneNum As String)
Dim PC As PhoneCalls
Dim RP As RuntimePermissions
If RP.Check(RP.PERMISSION_CALL_PHONE) = False Then 'if no existing phone call permission
MsgboxAsync(CallReason,"Call Permission") 'explain why this apps needs call permission
Wait For MsgBox_Result (Result As Int)
RP.CheckAndRequest(RP.PERMISSION_CALL_PHONE) 'prompt for permission
Wait For Activity_PermissionResult (Permission As String, AskResult As Boolean)
If AskResult = False Then 'user did not give permission
Return 'abort dial
End If
End If
StartActivity(PC.Call(PhoneNum)) 'dial number
End Sub