Språk

SmsManager.SendTextMessageWithoutPersisting Method

Definition

Send a text based SMS without writing it into the SMS Provider.

[Android.Runtime.Register("sendTextMessageWithoutPersisting", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/app/PendingIntent;Landroid/app/PendingIntent;)V", "", ApiSince=28)]
public void SendTextMessageWithoutPersisting(string? destinationAddress, string? scAddress, string? text, Android.App.PendingIntent? sentIntent, Android.App.PendingIntent? deliveryIntent);
[<Android.Runtime.Register("sendTextMessageWithoutPersisting", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/app/PendingIntent;Landroid/app/PendingIntent;)V", "", ApiSince=28)>]
member this.SendTextMessageWithoutPersisting : string * string * string * Android.App.PendingIntent * Android.App.PendingIntent -> unit

Parameters

destinationAddress
String

The destination phone number.

scAddress
String

The service-center address, or null to use the current default SMS service center.

text
String

The text of the SMS message.

sentIntent
PendingIntent

An optional pending intent notified when the send operation completes.

deliveryIntent
PendingIntent

An optional pending intent notified when a delivery report is received.

Attributes

Remarks

Send a text based SMS without writing it into the SMS Provider.

The message will be sent directly over the network and will not be visible in SMS applications. Intended for internal carrier use only.

Requires Permission: Both android.Manifest.permission#SEND_SMS and android.Manifest.permission#MODIFY_PHONE_STATE, or that the calling app has carrier privileges (see TelephonyManager#hasCarrierPrivileges), or that the calling app is the default IMS app (see CarrierConfigManager#KEY_CONFIG_IMS_PACKAGE_OVERRIDE_STRING).

<strong>Note:</strong> This method is intended for internal use by carrier applications or the Telephony framework and will never trigger an SMS disambiguation dialog. If this method is called on a device that has multiple active subscriptions, this SmsManager instance has been created with #getDefault(), and no user-defined default subscription is defined, the subscription ID associated with this message will be INVALID, which will result in the SMS being sent on the subscription associated with logical slot 0. Use #getSmsManagerForSubscriptionId(int) to ensure the SMS is sent on the correct subscription.

Java documentation for android.telephony.SmsManager.sendTextMessageWithoutPersisting(java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to