2014-11-16 48 views
0

我發現很多鏈接,人們給出瞭解決此問題的選項,但我知道如何解決此問題。手機間隙registerForRemoteNotificationTypes:在iOS 8.0及更高版本中不受支持

允許我從頭開始解釋我的項目。

我使用Xcode 6.0和phonegap最新版本。我已經從github添加PushPlugin

一旦我運行該項目,我打賭這個錯誤「registerForRemoteNotificationTypes:在iOS 8.0及更高版本中不受支持。」

有些身體可以幫助我如何解決這個問題。

+0

您使用的是哪個版本的PhoneGap/cordova? –

+0

@MichaelDautermann phonegap 2.9.1 – SKumar

回答

0

When I look in PushPlugin's code,我看到它應該是正確處理了iOS 8案例:

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 
    if ([[UIApplication sharedApplication]respondsToSelector:@selector(registerUserNotificationSettings:)]) { 
     UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UserNotificationTypes categories:nil]; 
     [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; 
     [[UIApplication sharedApplication] registerForRemoteNotifications]; 
    } else { 
      [[UIApplication sharedApplication] registerForRemoteNotificationTypes:notificationTypes]; 
    } 
#else 
     [[UIApplication sharedApplication] registerForRemoteNotificationTypes:notificationTypes]; 
#endif 

現在我取這個從the original PushPlugin repo

您應該1)查看您的PushPlugin.m文件,以確保代碼正在處理iOS 8的情況下,2)如果沒有,您應該獲取an iOS 8 compatible version of the PushPlugin repo

相關問題