problems with smsinterceptor, helpme please

fifiddu70

Well-Known Member
Licensed User
Longtime User
because smsinterceptor does not work? this application.
I would like the arrival of a message with the inscription On the ringtone and vibration must be enabled, but the arrival of a message written Off, you should turn off the ringer and vibrate.
this the code:
B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
     Dim notification1 As Notification
    Dim SI As SmsInterceptor
   End Sub
Sub Service_Create
   SI.Initialize2("SI",999)
      
End Sub

Sub Service_Start (StartingIntent As Intent)
   
   StartServiceAt("", DateTime.Now + 0.1 * DateTime.TicksPerMinute, False)
   
End Sub

Sub Service_Destroy

End Sub
Sub SI_MessageReceived (From As String, Body As String) As Boolean
    ToastMessageShow(From, True)
   If Body = "Off" Then
   notification1.Initialize
   notification1.Icon = "icon"
   notification1.Vibrate = False
   notification1.sound = False
   notification1.AutoCancel = True
   End If
   If Body = "On" Then
   notification1.Initialize
   notification1.Icon = "icon"
   notification1.Vibrate = True
   notification1.sound = True
   notification1.AutoCancel = False
   End If
   Return True
End Sub
any use, setting the ringtone doesn't sound, why?
 

caspali

Member
Licensed User
Longtime User
smsinterceptor

when i send a sms , the first message is show with default app, the second with smsinterceptor.

Why?
 
Upvote 0
Top