我正在处理一个项目,通过短信向朋友发送Firebase动态链接邀请。当我发送较小的链接作为邀请时,我的代码能够完美运行并发送短信。
try {
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(number, null, "Check It Out. This one is very nice and useful https://v5uht.app.goo.gl/Zi7X", null, null);
Toast.makeText(getApplicationContext(), "Cheers :D :D", Toast.LENGTH_LONG).show();
}
catch (Exception e) {
Toast.makeText(getApplicationContext(), "SMS faild, please try again.", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
然而,当我包含超过一个短信字符限制的更大链接时,它并不发送短信,尽管显示弹出通知。
String myNewLink = "https://v5uht.app.goo.gl/?link=http://expensecount.com/&apn=com.chtl.ribath.fdynamic1&amv=1&afl=https://play.google.com/store/apps/details?id%3Dcom.belief.colorgalaxy&myPage=2";
try {
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(number, null, myNewLink, null, null);
Toast.makeText(getApplicationContext(), "Cheers :D :D", Toast.LENGTH_LONG).show();
}
catch (Exception e) {
Toast.makeText(getApplicationContext(), "SMS faild, please try again.", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
我该怎么做才能把在myNewLink中的整个链接包含进来并使其正常工作。 谢谢。