Programatically send SMS Android (Not receiving status)

前端 未结 2 1444
野的像风
野的像风 2021-01-23 17:52

I am using http://mobiforge.com/developing/story/sms-messaging-android code example word for word except for the fact that I changed:

import android.telephony.gs         


        
2条回答
  •  醉梦人生
    2021-01-23 18:35

    For anyone having this problem now, if you're testing this on Android 4.4 or later, it will not work unless your app is the default SMS app.

    From the docs -

    Beginning with Android 4.4, the system settings allow users to select a "default SMS app." Once selected, only the default SMS app is able to write to the SMS Provider and only the default SMS app receives the SMS_DELIVER_ACTION broadcast when the user receives an SMS or the WAP_PUSH_DELIVER_ACTION broadcast when the user receives an MMS. The default SMS app is responsible for writing details to the SMS Provider when it receives or sends a new message.

    See here.

提交回复
热议问题