我有一个应用程序,我想收到短信时作出反应; 直到iOS 7,这通过注册到CTTelephonyCenter这样工作:
id center = CTTelephonyCenterGetDefault();
CTTelephonyCenterAddObserver(center,
NULL,
callback,
NULL,
NULL,
CFNotificationSuspensionBehaviorHold);
Run Code Online (Sandbox Code Playgroud)
并在回调检查kCTMessageReceivedNotification.这在iOS 8中不再起作用,因为我收到的通知类型远少于iOS 7,并且没有与消息接收有关.我认为这是关于一项新的权利,但如果是这样的话,还无法确定,以及所需的权利是多少.有人知道如何解决这个问题吗?