diff --git a/src/CoreTelephony/CoreTelephony.cs b/src/CoreTelephony/CoreTelephony.cs index d5e4f3a53a..683e0782e5 100644 --- a/src/CoreTelephony/CoreTelephony.cs +++ b/src/CoreTelephony/CoreTelephony.cs @@ -49,4 +49,12 @@ namespace CoreTelephony { Restricted, NotRestricted } + + [iOS (12,0)] + [Native] + public enum CTCellularPlanProvisioningAddPlanResult : long { + Unknown, + Fail, + Success, + } } diff --git a/src/coretelephony.cs b/src/coretelephony.cs index c546991a0f..66e17de3dd 100644 --- a/src/coretelephony.cs +++ b/src/coretelephony.cs @@ -69,9 +69,11 @@ namespace CoreTelephony { [BaseType (typeof (NSObject))] interface CTTelephonyNetworkInfo { + [Deprecated (PlatformName.iOS, 12,0, message: "Use 'ServiceSubscriberCellularProviders' instead.")] [Export ("subscriberCellularProvider", ArgumentSemantic.Retain)] CTCarrier SubscriberCellularProvider { get; } + [Deprecated (PlatformName.iOS, 12,0, message: "Use 'ServiceSubscriberCellularProvidersDidUpdateNotifier' instead.")] [NullAllowed] // by default this property is null [Export ("subscriberCellularProviderDidUpdateNotifier")] #if XAMCORE_2_0 @@ -80,8 +82,29 @@ namespace CoreTelephony { CTCarrierEventHandler CellularProviderUpdatedEventHandler { get; set; } #endif + [Deprecated (PlatformName.iOS, 12,0, message: "Use 'ServiceCurrentRadioAccessTechnology' instead.")] [iOS (7,0), Export ("currentRadioAccessTechnology")] NSString CurrentRadioAccessTechnology { get; } + + [iOS (12,0)] + [NullAllowed] + [Export ("serviceSubscriberCellularProviders", ArgumentSemantic.Retain)] + NSDictionary ServiceSubscriberCellularProviders { get; } + + [iOS (12,0)] + [NullAllowed] + [Export ("serviceCurrentRadioAccessTechnology", ArgumentSemantic.Retain)] + NSDictionary ServiceCurrentRadioAccessTechnology { get; } + + [iOS (12,0)] + [NullAllowed] + [Export ("serviceSubscriberCellularProvidersDidUpdateNotifier", ArgumentSemantic.Copy)] + Action ServiceSubscriberCellularProvidersDidUpdateNotifier { get; set; } + + [iOS (12,0)] + [Notification] + [Field ("CTServiceRadioAccessTechnologyDidChangeNotification")] + NSString ServiceRadioAccessTechnologyDidChangeNotification { get; } } #if !XAMCORE_2_0 @@ -141,4 +164,37 @@ namespace CoreTelephony { [Export ("subscriber")] CTSubscriber Subscriber { get; } } + + [iOS (12,0)] + [BaseType (typeof (NSObject))] + interface CTCellularPlanProvisioningRequest : NSSecureCoding { + [Export ("address")] + string Address { get; set; } + + [NullAllowed, Export ("matchingID")] + string MatchingId { get; set; } + + [NullAllowed, Export ("OID")] + string Oid { get; set; } + + [NullAllowed, Export ("confirmationCode")] + string ConfirmationCode { get; set; } + + [NullAllowed, Export ("ICCID")] + string Iccid { get; set; } + + [NullAllowed, Export ("EID")] + string Eid { get; set; } + } + + [iOS (12,0)] + [BaseType (typeof (NSObject))] + interface CTCellularPlanProvisioning { + [Export ("supportsCellularPlan")] + bool SupportsCellularPlan { get; } + + [Async] + [Export ("addPlanWith:completionHandler:")] + void AddPlan (CTCellularPlanProvisioningRequest request, Action completionHandler); + } } diff --git a/tests/xtro-sharpie/iOS-CoreTelephony.todo b/tests/xtro-sharpie/iOS-CoreTelephony.todo deleted file mode 100644 index ed03eba625..0000000000 --- a/tests/xtro-sharpie/iOS-CoreTelephony.todo +++ /dev/null @@ -1,22 +0,0 @@ -!missing-enum! CTCellularPlanProvisioningAddPlanResult not bound -!missing-field! CTServiceRadioAccessTechnologyDidChangeNotification not bound -!missing-selector! CTCellularPlanProvisioning::addPlanWith:completionHandler: not bound -!missing-selector! CTCellularPlanProvisioning::supportsCellularPlan not bound -!missing-selector! CTCellularPlanProvisioningRequest::address not bound -!missing-selector! CTCellularPlanProvisioningRequest::confirmationCode not bound -!missing-selector! CTCellularPlanProvisioningRequest::EID not bound -!missing-selector! CTCellularPlanProvisioningRequest::ICCID not bound -!missing-selector! CTCellularPlanProvisioningRequest::matchingID not bound -!missing-selector! CTCellularPlanProvisioningRequest::OID not bound -!missing-selector! CTCellularPlanProvisioningRequest::setAddress: not bound -!missing-selector! CTCellularPlanProvisioningRequest::setConfirmationCode: not bound -!missing-selector! CTCellularPlanProvisioningRequest::setEID: not bound -!missing-selector! CTCellularPlanProvisioningRequest::setICCID: not bound -!missing-selector! CTCellularPlanProvisioningRequest::setMatchingID: not bound -!missing-selector! CTCellularPlanProvisioningRequest::setOID: not bound -!missing-selector! CTTelephonyNetworkInfo::serviceCurrentRadioAccessTechnology not bound -!missing-selector! CTTelephonyNetworkInfo::serviceSubscriberCellularProviders not bound -!missing-selector! CTTelephonyNetworkInfo::serviceSubscriberCellularProvidersDidUpdateNotifier not bound -!missing-selector! CTTelephonyNetworkInfo::setServiceSubscriberCellularProvidersDidUpdateNotifier: not bound -!missing-type! CTCellularPlanProvisioning not bound -!missing-type! CTCellularPlanProvisioningRequest not bound