How to determine whether the iPhone has been inserted into the SIM card

Source: Internet
Author: User

To determine whether the iPhone has a SIM card, refer to the systemconfigure framework tutorial on the official website of Apple to copy the following code to the header file.

Extern NSString * const kctsmessagereceivednotification;
Extern NSString * const kctsmessagereplacereceivednotification;
Extern NSString * const kctsimsuppsimsimstatusnotinserted;
Extern NSString * const kctsimsuppsimsimstatusready;

Id CTTelephonyCenterGetDefault (void );
Void CTTelephonyCenterAddObserver (id, id, CFNotificationCallback, NSString *, void *, int );
Void CTTelephonyCenterRemoveObserver (id, id, NSString *, void *);
Int ctsmessagegetunreadcount (void );

Int ctsmessagegetrecordidentifier (void * msg );
NSString * CTSIMSupportGetSIMStatus ();
NSString * ctsimsuppcopycopymobilesubscriberidentity ();

Id ctsmessagecreate (void * unknow/* always 0 */, NSString * number, NSString * text );
Void * ctsmessagecreatereply (void * unknow/* always 0 */, void * forwardTo, NSString * text );

Void * ctsmessagesend (id server, id msg );

NSString * ctsmessagecopyaddress (void *, void *);
NSString * ctsmessagecopytext (void *, void *);

Then, CoreTelephony. framework is introduced to use [ctsimsuppgetgetsimstatus () isEqualToString: kctsimsuppsimsimstatusnotinserted] for determination.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.