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.

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.