Closed bzark closed 2 years ago
I have the same problem.
@shounakmulay any insight or things we can try to see what the issue is?
Hey @bzark seems like this could be a battery optimization issue. Have a look at #115
I tried it on three different phone all running different versions of Android. Also I'm not even testing background, this is not working when the app is actively the foreground app.
I turned battery optimization off for the example app and then ran it. Still not receiving notifications in the app when it is foreground.
@shounakmulay @karlreginaldo
I figured out the issue, has nothing to do with battery optimization. It has to do with what SMS client has the highest priority and it looks like Google has been maxing out that value so you cannot override their default messaging client. I even set MySmsReceiver to the same priority value 214748364 but Googles app still shows up as receiver #0.
C:\tmp\code\Telephony>adb shell cmd package query-receivers --brief -a android.provider.Telephony.SMS_RECEIVED 5 receivers found: Receiver #0: priority=2147483647 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false com.google.android.apps.messaging/.shared.receiver.ConfigSmsReceiver Receiver #1: priority=9999999 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false com.example.smsreceiver/.MySmsReceiver Receiver #2: priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false com.google.android.gms/.chimera.GmsIntentOperationService$GmsExternalReceiver Receiver #3: priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false com.lge.email/.receiver.SmsReceiver Receiver #4: priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false com.example.sms/com.shounakmulay.telephony.sms.IncomingSmsReceiver
Issue marked stale due to no activity.
the reason it doesn't work is because google messenger, which is default for android, doesn't send forward the messages. i downloaded and set Textra as default messaging app, and now it works
I cloned the repo, built it using Android Studio and installed the app on my OnePlus 9 Pro and when I send a text message to my phone it doesn't receive it in the app. Permissions where accepted on first launch. What is the issue?