SubscriptionInfo.Number Property

Definition

Returns the number of this subscription.

public virtual string? Number { [Android.Runtime.Register("getNumber", "()Ljava/lang/String;", "GetGetNumberHandler", ApiSince=22)] get; }
[<get: Android.Runtime.Register("getNumber", "()Ljava/lang/String;", "GetGetNumberHandler", ApiSince=22)>]
member this.Number : string

Property Value

the number of this subscription, or an empty string if one of these requirements is not met

Attributes

Remarks

Returns the number of this subscription.

Starting with API level 30, returns the number of this subscription if the calling app meets one of the following requirements: <ul> <li>If the calling app's target SDK is API level 29 or lower and the app has been granted the READ_PHONE_STATE permission. <li>If the calling app has been granted any of READ_PRIVILEGED_PHONE_STATE, READ_PHONE_NUMBERS, or READ_SMS. <li>If the calling app has carrier privileges (see TelephonyManager#hasCarrierPrivileges). <li>If the calling app is the default SMS role holder. </ul>

This member is deprecated. use SubscriptionManager#getPhoneNumber(int) instead, which takes a #getSubscriptionId() subscription ID.

Java documentation for android.telephony.SubscriptionInfo.getNumber().

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