How to prevent the default Messaging "steal" SMS from my smsinterceptor app?

bsnqt

Active Member
Licensed User
Longtime User
Hi Erel and Experts,

I am working with an application using smsInterceptor service. My app is working well and I can intercept successfully the incoming text messages.

The only issue I get is when the user turn off his device. Once he turns on his device back, the device's default Messaging application will be back faster than my app.

Hence all the pending text messages (which are sent to the user during the phone off time) will go immediately to this Messaging app. My app is running later (after Messaging), so it will not be able to intercept those messages, which are expected to be intercepted and are already "stolen" by the system Messaging.

How can I prevent the Messaging app "steal" the messages? I believe I need to make my app to be the default messaging, but is it possible?

Thank you.
bsnqt
 
Last edited:

bsnqt

Active Member
Licensed User
Longtime User
You can create a static intent filter: Classes are soon coming...

And set the priority to a high value: <intent-filter> | Android Developers

Note that you will not be able to prevent the message from reaching other receivers (like done with SmsInterceptor).

Dear Erel,

Your answer is very appreciated. The only concern is exactly like you pointed out below, i.e I need to work with smsInterceptor to handle (prevent) messages - to reach the other receiver once it comes to the receiver.

It does mean that we have to scarifice one? --> or intent (can have higher priority) or SmsInterceptor (slower)?
 
Last edited:
Upvote 0
Top