getHintForPhoneNumber(_:completion:)
Provides an estimate of the system’s confidence of the existence of an active cellular plan for the device’s phone number.
Declaration
class func getHintForPhoneNumber(_ phoneNumber: String, completion completionHandler: @escaping @Sendable (CTCellularPlanStatusAvailability, CTCellularPlanStatusAvailabilityConfidence, (any Error)?) -> Void)class func hint(forPhoneNumber phoneNumber: String) async throws -> (CTCellularPlanStatusAvailability, CTCellularPlanStatusAvailabilityConfidence)Parameters
- phoneNumber:
A phone number in T REC E (for example,
+15550001234). - completionHandler:
A closure the framework calls with the cellular plan availability, confidence level, and any error that occurs.
Discussion
Upon completion, the CTCellularPlanStatusAvailability instance in the handler indicates whether the device has a cellular plan for the given phone number and the framework’s confidence (CTCellularPlanStatusAvailabilityConfidence) that the determination is true.
Only call this method after you receive an CTCellularPlanStatusAuthorization.authorized status from requestAuthorization(forPhoneNumber:completion:) or getAuthorizationStatus(forPhoneNumber:completion:).