Parse.com代码给出了错误

时间:2015-10-30 17:07:49

标签: xcode swift parse-platform xcode7

我使用的代码来自:aviary sdk

我正在运行Xcode 7.1,而我正在使用的代码会出现多个错误。

错误是;二元运算符“|”不能应用于两个UIRemoteNotificationType,远程通知注册仅适用于iOS 8或更高版本。

以下是代码行:

if application.respondsToSelector("registerUserNotificationSettings:") {
        let userNotificationTypes = UIUserNotificationType.Alert |   UIUserNotificationType.Badge | UIUserNotificationType.Sound
        let settings = UIUserNotificationSettings(forTypes: userNotificationTypes, categories: nil)
        application.registerUserNotificationSettings(settings)
        application.registerForRemoteNotifications()
    } else {
        let types = UIRemoteNotificationType.Badge | UIRemoteNotificationType.Alert | UIRemoteNotificationType.Sound
        application.registerForRemoteNotificationTypes(types)
    }

0 个答案:

没有答案