SmsManager.CreateAppSpecificSmsToken(PendingIntent) Method

Definition

Create a single use app specific incoming SMS request for the calling package.

[Android.Runtime.Register("createAppSpecificSmsToken", "(Landroid/app/PendingIntent;)Ljava/lang/String;", "", ApiSince=26)]
public string? CreateAppSpecificSmsToken (Android.App.PendingIntent? intent);
[<Android.Runtime.Register("createAppSpecificSmsToken", "(Landroid/app/PendingIntent;)Ljava/lang/String;", "", ApiSince=26)>]
member this.CreateAppSpecificSmsToken : Android.App.PendingIntent -> string

Parameters

intent
PendingIntent

Returns

Token to include in an SMS message. The token will be 11 characters long.

Attributes

Remarks

Create a single use app specific incoming SMS request for the calling package.

This method returns a token that if included in a subsequent incoming SMS message will cause intent to be sent with the SMS data.

The token is only good for one use, after an SMS has been received containing the token all subsequent SMS messages with the token will be routed as normal.

An app can only have one request at a time, if the app already has a request pending it will be replaced with a new request.

<p class="note"><strong>Note:</strong> This method 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 operation being completed on the subscription associated with logical slot 0. Use #getSmsManagerForSubscriptionId(int) to ensure the operation is performed on the correct subscription. </p>

Java documentation for android.telephony.SmsManager.createAppSpecificSmsToken(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