小编Mat*_*son的帖子

解析推送通知 - Swift安装不起作用

我试图在我的应用程序(所有swift)上运行Parse推送通知,但在尝试实现时,我收到错误 'PFInstallation' does not have a member named 'saveInBackground'

这是我的代码.

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    Parse.setApplicationId("APP ID HIDDEN", clientKey: "CLIENT ID HIDDEN")

   // let notificationTypes:UIUserNotificationType = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
    //let notificationSettings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: notificationTypes, categories: nil)
    var notificationType: UIUserNotificationType = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound

    var settings: UIUserNotificationSettings = UIUserNotificationSettings(forTypes: notificationType, categories: nil)
    UIApplication.sharedApplication().registerUserNotificationSettings(settings)
    UIApplication.sharedApplication().registerForRemoteNotifications()

    //UIApplication.sharedApplication().registerUserNotificationSettings(notificationSettings)
    // Override point for customization after application launch.
    return true
}

func application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings!) …
Run Code Online (Sandbox Code Playgroud)

notifications push parse-platform swift

8
推荐指数
2
解决办法
4407
查看次数

标签 统计

notifications ×1

parse-platform ×1

push ×1

swift ×1