Joke Collection Website - Public benefit messages - How to realize the scanning interception of short messages in Iphone jailbreak development?

How to realize the scanning interception of short messages in Iphone jailbreak development?

1. First is the callback function.

static electricity

Void callback (CFNotificationCenterRef center, void * observer,

CFStringRef name, const void *object, CFDictionaryRef userInfo)

{

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

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

Message: @ \ \ \ "You have a new message, please check it! \ \ \ "Principal: zero

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

[Alarm display];

[Alarm release];

}

}

2. Registration of notices

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

3. Run the code and try to send a short message.