To determine whether the iPhone has a SIM card, refer to the systemconfigure framework tutorial on the official website of AppleCodeCopy to 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.
Ctsimsupportgetsimstatus () output:
Kctsimsuppsimsimstatusnotinserted when no SIM card is available
Kctsimsuppsimsimstatusready with SIM card