como receber a mensagem ao receber a notificação “kCTMessageReceivedNotification” no IOS5
Com o ios4.x, posso usar o código abaixo para receber a mensagem quando receber a notificação "kCTMessageReceivedNotification"
CTTelephonyCenterAddObserver( ct, NULL, callback,NULL,NULL, CFNotificationSuspensionBehaviorHold);
if ([notifyname isEqualToString:@"kCTMessageReceivedNotification"])//receive message
{
NSDictionary *info = (NSDictionary *)userInfo;
CFNumberRef msgID = (CFNumberRef)[info objectForKey:@"kCTMessageIdKey"];
int result;
CFNumberGetValue((CFNumberRef)msgID, kCFNumberSInt32Type, &result);
Class CTMessageCenter = NSClassFromString(@"CTMessageCenter");
id mc = [CTMessageCenter sharedMessageCenter];
id incMsg = [mc incomingMessageWithId: result];}
Mas com o ios5 eu não posso fazer isso porque o incMsg é nulo, então o que posso fazer para receber a mensagem?
obrigado