Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not using SmsManager for direct SMS transmission #57

Open
s681562 opened this issue Dec 21, 2021 · 0 comments
Open

Not using SmsManager for direct SMS transmission #57

s681562 opened this issue Dec 21, 2021 · 0 comments

Comments

@s681562
Copy link

s681562 commented Dec 21, 2021

This is not an issue, but please update your code for using direct SMS transmission (without popup or additional view).
It is more user friendly without additional popup for pre-edit the sms content.
Why user must see the edit page, if the app already prepared the content for the sms?

await sendSMS(...) should send SMS directly without delay or sms popup edit page.

In Android you can do:

// SmsManager is android.telephony
String destinationAddress = "35235235;235423523";
String msg = "Text to send bla bla bla";
PendingIntent sentIntent = PendingIntent.getBroadcast(this, 0, new Intent("SMS_SENT_ACTION"), 0);
SmsManager mSmsManager = SmsManager.getDefault();
String numbers[] = destinationAddress.split(";");

for(String num : numbers) {
Logger.d(this, "msg.length() : " + msg.getBytes().length);
if(msg.getBytes().length > 80) {
ArrayList partMessage = mSmsManager.divideMessage(msg);
mSmsManager.sendMultipartTextMessage(num, null, partMessage, null, null);
}else {
mSmsManager.sendTextMessage(num, null, msg, sentIntent, null);
}
}

Thank you in advance.

SilkyPants pushed a commit to NextFaze/flutter_sms that referenced this issue Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant