2014-11-06 43 views
1

我的應用程序APNS在少於ios8的情況下運行良好,但在ios8中,我沒有獲取設備標記,甚至沒有調用RegisterForRemoteNotificationsWithDeviceToken委託方法。請指教。IOS8註冊Notificaton無法正常工作。爲什麼?

+0

顯示您的APNS註冊代碼。 – 2014-11-06 10:59:10

回答

1

我有同樣的問題,我的應用程序一起,並參考以下鏈接並解決此

可點擊的鏈接

Get Device Token in iOS 8

#ifdef __IPHONE_8_0 
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings: (UIUserNotificationSettings *)notificationSettings 
{ 
//register to receive notifications 
[application registerForRemoteNotifications]; 
} 

- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler 
{ 
    //handle the actions 
if ([identifier isEqualToString:@"declineAction"]){ 
} 
else if ([identifier isEqualToString:@"answerAction"]){ 
} 
} 
#endif