Contents

CTCellularPlanStatus

An object that validates tokens for UPI device verification or checks the availability of cellular plans for a phone number.

Declaration

class CTCellularPlanStatus

Overview

This class provides UPI device validation or cellular plan availability checking.

Perform UPI device validation

To check if the Integrated Circuit Card Identifier (ICCID) on a device is associated with a given token, use the setUPIVerificationCodeSendCompletion(_:) method to configure an instance of a view for Unified Payments Interface (UPI) device validation. When the person sends an SMS, the framework creates a token and maps it to the MFMessageComposeViewController instance’s associated ICCID. Use this token to determine if changes exist to the underlying ICCID.

Call getTokenWithCompletion(_:) to retrieve the token. Your app has 30 seconds from sending the SMS before the framework drops the token. If the SMS fails, the framework revokes the token.

Use checkValidity(ofToken:completionHandler:) to check the status of the token. The method returns true if the ICCID is present and turned on.

For more information on configuring an instance for UPI device validation, see setUPIVerificationCodeSendCompletion(_:).

Check cellular plan continuity

To check the status of a cellular plan, use requestAuthorization(forPhoneNumber:completion:) to ask the person for permission to access status information for a phone number. Provide phone numbers in ITU-T E.164 international format (for example, +15550001234).

After the person grants authorization, the getHintForPhoneNumber(_:completion:) method suggests whether an active cellular plan exists for the phone number by providing:

CTCellularPlanStatusAvailability

An indicator that a cellular plan for the phone number exists on the device

CTCellularPlanStatusAvailabilityConfidence

A confidence level that the plan is active based on recent cellular activity

After the person answers the permission prompt once, your app can query getAuthorizationStatus(forPhoneNumber:completion:) to check for existing authorization without presenting any UI.

Topics

Getting and storing a token

Checking the validity of the ICCID

Requesting phone number authorization

Checking authorization status

Getting a cellular plan status hint