8

On iOS 7, CTSubscriber was added to the CoreTelephony framework. There is no documentation available, only its header file:

/*
 * 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

Also, on What's new on iOS 7, this is mentioned:

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.

I think that CTSubscriber is related to the bold part of the text. However, I haven't found anything related on how this happens.

I have tried to use the following code (added to application:didFinishLaunchingWithOptions:) to experiment with this API, but the notification is never fired and carrierToken returns 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);
}];

So, I have the following questions:

Marcelo
  • 9,916
  • 3
  • 43
  • 52
  • please take a look http://stackoverflow.com/questions/18961271/coretelephony-framework-ios-7 – Nitin Gohel Jan 06 '14 at 06:14
  • This does not answer my questions. It's only said that some methods are private (the ones I posted are public) and the information I posted (documentation and header) are there too. – Marcelo Jan 06 '14 at 06:19

2 Answers2

4

I asked the same question in the developer forums and got this reply :

You should escalate this via the carrier you're working with, who can in turn escalate it to their contact at Apple.

Link to the thread: https://devforums.apple.com/message/934226#934226

Petter
  • 3,031
  • 1
  • 18
  • 12
  • It seems that this is the better answer someone can get. Just in case, I'll wait a little before giving the bounty. – Marcelo Jan 16 '14 at 13:57
  • The link does not work anymore .. Is there any documentation or samples on how to use it in more details ? – AmineG Feb 17 '16 at 10:03
-1

The reason you can’t find any documentation is because much of Core Telephony consists of private APIs. Consequently, there isn’t any way to access the SIM card from an app published on the App Store. A jailbroken device is, of course, another story, but in that case you’re pretty much on your own.

Edit:

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.

codercat
  • 22,873
  • 9
  • 61
  • 85
  • So why did Apple made the methods I mentioned public? – Marcelo Jan 16 '14 at 13:27
  • I know that. It's mentioned on my question. What I want to know is how "Apps developed in conjunction with a carrier can also authenticate against a particular subscriber for that carrier". – Marcelo Jan 16 '14 at 13:55