-
Notifications
You must be signed in to change notification settings - Fork 141
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
Receive error message when trying to send a SMS using 'SMS Cordova plugin' #89
Comments
Thanks Jaakov
Obter o Outlook para Android<https://aka.ms/AAb9ysg>
…________________________________
From: Jaacov ***@***.***>
Sent: Sunday, July 9, 2023 7:48:54 AM
To: floatinghotpot/cordova-plugin-sms ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [floatinghotpot/cordova-plugin-sms] Receive error message when trying to send a SMS using 'SMS Cordova plugin' (Issue #89)
I am trying to send a simple SMS with my Android phone (version 13) but receive the following error:
com.outsystemscloud.personaldu4qbox5.TestApp: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
Anyone knows what could be the problem?
Kind regards,
Jaacov
—
Reply to this email directly, view it on GitHub<#89>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACKICCDLSY7OBZRPMIV3WDTXPKEBNANCNFSM6AAAAAA2DNPP44>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
private PluginResult sendSMS(JSONArray addressList, String text, CallbackContext callbackContext) {
Log.d(LOGTAG, ACTION_SEND_SMS);
if (this.cordova.getActivity().getPackageManager().hasSystemFeature("android.hardware.telephony")) {
int n;
if ((n = addressList.length()) > 0) {
SmsManager sms = SmsManager.getDefault();
for (int i = 0; i < n; ++i) {
String address = addressList.optString(i);
if (address.length() > 0) {
// Create a unique requestCode for each PendingIntent
int requestCode = (int) System.currentTimeMillis();
PendingIntent sentIntent = PendingIntent.getBroadcast(
(Context) this.cordova.getActivity(),
requestCode,
new Intent("SENDING_SMS"),
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE
);
sms.sendTextMessage(address, null, text, sentIntent, null);
}
}
callbackContext.success("SMS sent successfully");
} else {
callbackContext.error("No valid recipients provided");
}
} else {
callbackContext.error("SMS is not supported");
}
return null;
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to send a simple SMS with my Android phone (version 13) but receive the following error:
com.outsystemscloud.personaldu4qbox5.TestApp: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
Anyone knows what could be the problem?
Kind regards,
Jaacov
The text was updated successfully, but these errors were encountered: