Send sms permission doesn't work

前端 未结 7 463
南方客
南方客 2021-01-14 07:37

I want to send a simple message and i have in my manifest, but I always get: java.la

7条回答
  •  孤街浪徒
    2021-01-14 08:11

    If you message is too long using smsManager.sendTextMessage(.. will fail quietly.

    You need to use smsManager.sendMultipartTextMessage(...

    SmsManager smsManager = SmsManager.getDefault();
    ArrayList messageList = smsManager.divideMessage(message.toString());
    smsManager.sendMultipartTextMessage(phoneNumber, null, messageList, null, null);
    

提交回复
热议问题