how to send sms from my android app with my name on it instead my phone number?

时间:2017-06-15 10:24:36

标签: android sms

In my android app i send sms message to users after they sign in (they write their phone number in the registration form). After they register i send sms to this phone to tell them welcome to the app or something like that (the content doesn't matter for now). But what i want to be seen that the user get sms from my app name but instead it shown that the getting sms is from the phone number that they used to register. I am using smsManager class to send the sms like this:

SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNumber,null,smsContent,null,null);

I have tried to change the second parameter from null to something else but nothing happened. So how can i send sms that the users will see that it comes from my app?

1 个答案:

答案 0 :(得分:0)

检查您的sendSMSMessage()方法。 sendTextMessage()中的第一个参数应该是您的服务号码。您可能已从用户输入将变量phoneNumber分配给getText。确保在phoneNumber

中配置自己的号码