在iOS 7上,CTSubscriber被添加到CoreTelephony框架中.没有可用的文档,只有它的头文件:
/* * CTSubscriberTokenRefreshed * * Description: * The name of the NSNotification sent when the carrier token is available. */ CORETELEPHONY_EXTERN NSString * const CTSubscriberTokenRefreshed __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); CORETELEPHONY_CLASS_AVAILABLE(7_0) @interface CTSubscriber : NSObject /* * carrierToken * * Description: * A data blob containing authorization information about the subscriber. * * May return nil if no token is available. */ @property (nonatomic,readonly,retain) NSData* carrierToken __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); @end
此外,在What’s new on iOS 7,这是提到:
The Core Telephony framework (
CoreTelephony.framework
) lets you get information about the type of radio technology in use by the device. Apps developed in conjunction with a carrier can also authenticate against a particular subscriber for that carrier.
我认为CTSubscriber与文本的大胆部分有关.但是,我没有发现任何与此有关的事情.
我尝试使用以下代码(添加到应用程序:didFinishLaunchingWithOptions :)来试验此API,但通知永远不会被触发,并且carrierToken返回nil:
CTSubscriber *subscriber = [CTSubscriberInfo subscriber]; NSLog(@"%@",subscriber.carrierToken); [[NSNotificationCenter defaultCenter] addObserverForName:CTSubscriberTokenRefreshed object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { NSLog(@"=========="); NSLog(@"%@",note); NSLog(@"%@",subscriber.carrierToken); }];
所以,我有以下问题:
>究竟什么(“授权信息”)carrierToken返回以及如何使它不是零?
> Apple如何知道您的应用是“与操作符共同开发”的?
>这是Evernote如何向Telefonica用户提供1年的高级帐户(http://blog.evernote.com/blog/2013/08/13/evernote-and-telefonica-announce-global-partnership/)? (可能不是,因为他们需要的信息可以在CTCarrier上获得)