I copied some code from an old app pre-google permissions but now it no long seems to work on my new s21. I asked for permissions which were granted on first app run
On my Samsung S21 the drop down window appears giving options to reply or call or mark as read. Could this be interferring with the capture? If so is it possible to prioritize my app? Does 999 need to be bigger?
B4X:
Sub GetP
Dim rp As RuntimePermissions
rp.CheckAndRequest(rp.PERMISSION_RECEIVE_SMS)
wait for Activity_PermissionResult(permission As String, result As Boolean)
If result=True Then
Log("User Permission Granted")
End If
SMSIntercept.Initialize2("SI",999)
Log("Initilize interceptor")
End Sub
Sub SI_MessageReceived(from As String, msg As String) As Boolean
'This is triggered when the the messages is received!
'Return true indicates all ok!
Log("Message received")
Log(msg)
Log(from)
Return True
End Sub
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...
Starting from Android 6 there is an Api from Google which can Listen for a Incoming SMS for you. But you do not need any Permission for this. The SMS ends up in the Devices standard SMS App but your app can do an Phoneauthentification using an SMS from your Server. Usually the way would be: 1...