User Tools

Site Tools


plugin_integration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
plugin_integration [2014/06/20 04:53]
superdupersms
plugin_integration [2015/01/04 21:39] (current)
superdupersms
Line 117: Line 117:
  
 The included class does URI resolution normally except that the standard "​sms"​ authority is replaced with the "​sdsms"​ authority. When SDMM is the Default Messaging App, SDMM will handle the call. If another app is the Default Messaging App, it will resolve to the standard "​sms"​ authority and your response message will be written to the SMS database. The included class does URI resolution normally except that the standard "​sms"​ authority is replaced with the "​sdsms"​ authority. When SDMM is the Default Messaging App, SDMM will handle the call. If another app is the Default Messaging App, it will resolve to the standard "​sms"​ authority and your response message will be written to the SMS database.
 +
 +10. **(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. Do **not** abort the SMS_RECEIVED intent using the system "​abort"​ call. Only perform the Android system "​abort"​ if SDMM is not installed. To properly **abort** when SDMM is install only perform the SDMM abort 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+, apps are **not** supposed to be able to abort the SMS_RECEIVED intent, but on some (or most) 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). This will create a bad user experience.
 +
 +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.
 +
 +**BETA WARNING**
 +
 +This is in Beta. SDMM will attempt to cancel any notifications related to the SMS message, but we are still working on ways to improve that experience. It appears to work on some platforms fairly well and on some platforms it is a "​poor"​ experience, but it still essentially works on all tested systems. ​
 +
 +Please test this since we do not have all devices available. Also, be aware that SDMM will attempt to dismiss any notifications related to the SMS. It my "​roll"​ and the ticker message may be visible briefly, but it should dismiss before being available in the notification drawer. However, we are working on improving the response time so that it will dismiss prior to even being displayed. It may be advisable to warn your users. (We are working on standard messaging for this.)
 +
 +Please let us know if you have difficulty with this feature. Thanks!
plugin_integration.txt ยท Last modified: 2015/01/04 21:39 by superdupersms