I'm trying to make an app which intercept and delete received messages with specific content. (The user might not read them).
I found this code on 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
I have two entitlements : com.apple.CommCenter.Messages-send and com.apple.coretelephony.Identity.get
And in the console I can see:
Mar 2 17:07:05 iPhone backboardd[38] <Error>: HID: The 'Passive' connection 'ReadMessage' access to protected services is denied.
I don't know if I must change the entitlements, or ? Any help will be great...