當前位置:名人名言大全網 - 祝福短信 - Iphone越獄開發如何實現短信的掃描攔截?

Iphone越獄開發如何實現短信的掃描攔截?

1.首先是回調函數。

靜電

void回調(CFNotificationCenterRef中心,void *觀察者,

CFStringRef名稱,const void *object,CFDictionaryRef userInfo)

{

if([(ns string *)name is equal tostring:kCTMessageReceivedNotification]){

uialertview * alert =[[uialertviewalloc]init with title:@ \ \ \ " Prompt \ \ \ "

留言:@\\\ \ "您有新留言,請查收!\\\ "委托人:零

CancelButtonTitle:@ \ \ \ \ " OK \ \ \ \ \ " otherButtonTitles:nil]];

[警報顯示];

[警報發布];

}

}

2.通知的登記

cttelephonycentraddobserver(CTTelephonyCenterGetDefault()、NULL、callBack、NULL、NULL、cfnotificationsuspensionbehaviorsdrop);

3.運行代碼並嘗試發送壹條短消息。