Android Question SMS Interecept partially intercepting

raphipps2002

Active Member
Licensed User
I have a simple app where I have set the intercept priority to 999 so it should be highest priorty. I did try 99999 too. My app receives as code, converts it and returns value back to the sender. However, the problem is the message 'passes' through my app (but it works) and the message ends up being received via my phone's normal sms thereby receiving it again and sending the message twice. Cant work out why 'Return True' should stop this surely?? I use an samsung s4.

B4X:
Sub StartListening

    SMSIntercept.Initialize2("SI",999)
   
    ToastMessageShow("I am listening",False)

End Sub


Sub SI_MessageReceived(from As String, msg As String) As Boolean
   
    ToastMessageShow("Received msg & msg",True)
       
    Dim i As Int = msg.IndexOf(" ")
   
    Dim ID As Int = msg.SubString2(0,i)
   
    Dim MobileNumber As String = msg.SubString2(i+1,msg.Length)
   
    Dim who As String = "New client"
   
    Dim DT As String = DateTime.Now
   
    Sql1.ExecNonQuery2("INSERT INTO SMSReceived VALUES(?,?,?,?,?,?)", Array As Object(Null,MobileNumber,"New client",ID,DT,"Y"))
   
    SendAnMail1(from,who,ID & "|" & MobileNumber)
   
    ....conversion code returning Akey

    ToastMessageShow(AKey.ToUpperCase,True)
   
    Psms.Send(MobileNumber," Key to use " & AKey.ToUpperCase)
   
    Return True

End Sub
 
Top