User12111111
User12111111

Reputation: 1219

Android: SMS is blocked by ChatON app

I have written an app which receives incoming SMSes, saves it and displays it to the users. Suddenly my app stopped receiving SMS due to Samsung's ChatOn app update.

Here is the my Manifest.xml:

 <uses-permission android:name="android.permission.RECEIVE_SMS" />


 <receiver android:name="com.myapp.sms.service.SMSReceiver"
     android:permission="android.permission.BROADCAST_SMS" android:exported="true">
     <intent-filter android:priority="999">
         <action android:name="android.provider.Telephony.SMS_RECEIVED" />
     </intent-filter>
 </receiver>

I had this issue earlier with Hangout which started supporting SMS. So, at that time I added priority to 999 (max value) in manifest file. And this worked.

But after recent update of ChatOn app, my app stopped receiving SMS. Please tell me how can I overcome with this.

For work around, I unchecked SMS option on ChatOn app.

Any help is appreciated.

Upvotes: 3

Views: 405

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007099

There is no guaranteed way that your app can get "first crack" at SMS messages, on Android 4.3 and below. Even if you set your app to be the highest possible priority, other apps can do the same. GoSMS notably does this, and you have indicated that ChatOn does as well. If they get the message first and abort the broadcast, you will not receive the message.

There is nothing that you can do, other than to detect this possibility (using PackageManager) and alert users as to the potential behavior.

Note that on Android 4.4, this is a lot different:

  • The broadcast can no longer be aborted
  • There are separate broadcasts for apps that are monitoring SMS and the actual final SMS client app

Upvotes: 2

Related Questions