Programatically send SMS Android (Not receiving status)

前端 未结 2 1441
野的像风
野的像风 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.

    0 讨论(0)
  • 2021-01-23 18:43

    Your code look pretty good to do. Maybe the problem is that your carrier does not provide you the delivery reports( there may be an option to subscribe to a service) or you have not turned on delivery reports in your mobile. There is helpful app on the play store called Delivery Reports from which you can see the status of each sms.

    0 讨论(0)
提交回复
热议问题