我是一名iOS开发人员,我试图构建一个具有自动激活功能的移动应用程序,我发现不仅仅是阅读短信的方式,而且只使用私有API,这将导致Apple拒绝我的应用程序.我有两个问题,并欣赏任何反馈都可以帮助我.
1-有没有办法在iOS平台上阅读短信而不面对Apple拒绝?2-任何人都可以向我提供Apple开发者文档中的相关部分,该部分描述了它不允许在iOS平台上阅读SMS消息吗?
使用ios4.x我可以使用下面的代码获取"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];}
Run Code Online (Sandbox Code Playgroud)
但是对于ios5我不能这样做因为incMsg是零,所以我该怎么做才能得到消息?
谢谢