我试图创建一个拦截和删除具有特定内容的已接收消息的应用。 (用户可能无法阅读它们。)
我在iPhoneDevWiki上找到了这段代码:
#import "RootViewController.h"
@implementation RootViewController
- (void)loadView {
self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
self.view.backgroundColor = [UIColor redColor];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(readAwesomeMessage:) name:@"CKConversationMessageReadNotification" object:nil];
}
-(void)readAwesomeMessage:(NSNotification *)notif {
for (NSString *key in [notif.userInfo allKeys]) {
id value = [notif.userInfo objectForKey:key];
NSLog(@"Class: %@ - Value : %@",[value class],value);
}
}
@end
我有两项权利:com.apple.CommCenter.Messages-send和com.apple.coretelephony.Identity.get
在控制台中我可以看到:
Mar 2 17:07:05 iPhone backboardd[38] <Error>: HID: The 'Passive' connection 'ReadMessage' access to protected services is denied.
我不知道是否必须更改权利,或者? 任何帮助都会很棒......