This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
install [2014/03/27 14:31] superdupersms |
install [2015/01/05 02:27] superdupersms |
||
---|---|---|---|
Line 101: | Line 101: | ||
In this example, the intent is processed and will be passed back to SDMM unless the callback returns a value of "true" - indicating that your app aborted the SMS broadcast. | In this example, the intent is processed and will be passed back to SDMM unless the callback returns a value of "true" - indicating that your app aborted the SMS broadcast. | ||
+ | |||
+ | 9. **(New with SDK 0.95) - BETA Feature: SDMM is NOT the Default SMS App** | ||
+ | |||
+ | To try to use your app **without** SDMM as the default messaging app, you | ||
+ | |||
+ | Remove your "abort" call if SDMM is installed. Only perform the SDMM "abort" if SDMM is not installed except on the SDMM Duplicate message. | ||
+ | |||
+ | SDMM will send a duplicate SMS_RECEIVED message to your app. To properly abort a message, you should **not** abort the original message. In Android KitKat+, an app is **not** supposed to be able to abort the SMS_RECEIVED intent, but on some (or all) platforms it can. If it does, then SDMM will not receive any notice of the SMS_RECEIVED (but the Default SMS App **will** get the SMS_DELIVERED intent). To allow for appropriate processing, your app should **not** abort the SMS_RECEIVED intent. Then, SDMM will query your app with a duplicate SMS_RECEIVED intent and that intent should return the ABORT flag to SDMM as demonstrated here: | ||
+ | |||
+ | <java code> String sdsmsDup = ""; | ||
+ | |||
+ | // look for this string for the duplicate SMS_RECEIVED broadcast | ||
+ | if (intent.hasExtra(SDSmsConsts.SDSMS_DUPLICATE)) sdsmsDup = SDSmsConsts.SDSMS_DUPLICATE; | ||
+ | |||
+ | // then check if the SMS_RECEIVED intent is an SDMM duplicate | ||
+ | // then indicate the abort accordingly | ||
+ | if (SDSmsConsts.SDSMS_DUPLICATE.equals(sdsmsDup)) { | ||
+ | // this code will abort the message in SDMM | ||
+ | // | ||
+ | Log.i(TAG, "aborting intent for SDSMS"); | ||
+ | setResultCode(0); | ||
+ | setResultData(SDSmsConsts.SDSMS_ABORT); | ||
+ | intent.putExtra(abort, true); | ||
+ | Log.i(TAG, "SDSmsManager found, duplicate intent signal for abort"); | ||
+ | |||
+ | } else if (!SDSmsManager.isSdsmsIntstalled()) { | ||
+ | |||
+ | // insert your code to abort intent for non-KitKat+ devices | ||
+ | // | ||
+ | Log.i(TAG, "SDSmsManager not found, aborting message"); | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | This will appropriately signal SDMM to abort the SMS_RECEIVED intent. When SDMM is not the default, you should not abort the broadcast in order for SDMM to process the intent appropriately. | ||
+ |