How to change sender mobile number in Android SMS service

前端 未结 2 1299
失恋的感觉
失恋的感觉 2021-01-07 07:41

I\'m sending SMS in my Android App,

 SmsManager sm = SmsManager.getDefault();
    String number = \"1234567890\";
    sm.sendTextMessage(number, null, \"Test         


        
相关标签:
2条回答
  • 2021-01-07 08:12

    No. It is not possible. Here are multiple reasons why:

    • When you send an sms, using SmsManager you encode it with the content - the actual text message itself. You also encode it with the phone number you are sending it to. And you encode the message center number to the message. That is all you get to encode. Then Android/hardware handles sending it over to the cell phone tower where it is then out of your hands.
    • If you somehow tried to encode the recipient phone number as text, then the carrier would have no idea how to handle the message. It wouldn't have anywhere to send it too.
    • Cell phones do not have inbound Caller (or sms) ID - unless the number is already programmed, of course.
    • When the carrier network is sending an sms, it goes through a message center. The message center determines what data is forwarded to the recipient phone. The message centers currently available just do not support what you're wanting - at least not to the consumer.
    0 讨论(0)
  • 2021-01-07 08:28

    Yes, it is possible to change the sender phone number, but you need to use a third party SMS Gateway. You can reroute the SMS to come from a phone number that you register for your app.

    Twilio - http://www.twilio.com/help/faq/sms/can-i-specify-the-phone-number-a-recipient-sees-when-getting-an-sms-from-my-twilio-app

    TextMagic - http://www.textmagic.com/app/pages/en/products/bulk-sms-gateway-api

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