Android Question intercepting sms in the background (B4A v8.00)

pesquera

Active Member
Licensed User
Hello,

I'm upgrading an app, compiled with B4A v8.00, RuntimePermissions and AutomaticForegroundMode, etc
The problem is that SMS are not intercepted at all

Based on this thread:
https://www.b4x.com/android/forum/t...cepting-sms-messages-in-the-background.20103/

Manifest:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="27"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
)
AddPermission(android.permission.SEND_SMS)
AddReceiverText(habilitar_smsread,
<intent-filter>
    <action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>)

habilitar_smsread Service_Create:
B4X:
        Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS

habilitar_smsread Service_Start:
B4X:
Sub Service_Start (StartingIntent As Intent)
   If StartingIntent.Action = "android.provider.Telephony.SMS_RECEIVED" Then
          Dim misSMSList As List
          misSMSList = rtn_ParseSmsIntent(StartingIntent)

   End If   
   Service.StopAutomaticForeground

Looking at logs, seems to be that Service_Sart is never fired

Thanks in advance
 

pesquera

Active Member
Licensed User
Please dismiss this post, it's solved now
I'm not sure about what was the problem.. that is what I did:
1) uninstall the app
2) downgrade to android:targetSdkVersion="22"
3) install the app, it works
4) upgrade to android:targetSdkVersion="26"
5) install the app, it works
6) upgrade to android:targetSdkVersion="27"

Now I'm testing.. all seems to be fine

Thanks and sorry for the inconvenience
 
Upvote 0
Top