Swift:从Parse.com注册通知不会保持启用状态

时间:2015-03-29 15:08:59

标签: swift parse-platform push-notification

我已将程序配置为接收来自Parse的通知,并且我已使用以下行启用它:

var pushSettings : UIUserNotificationSettings = UIUserNotificationSettings(forTypes: .Alert, categories: nil)

application.registerUserNotificationSettings(pushSettings)

application.registerForRemoteNotifications()

let userNotificationTypes = (UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound);

let settings = UIUserNotificationSettings(forTypes: userNotificationTypes, categories: nil)

application.registerUserNotificationSettings(settings)

application.registerForRemoteNotifications()

声明在

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

来自我的appDelegate,但是当我关闭我的程序并重新启动它时,所有参数都被重置,我将它们“关闭”

有没有人有想法?

0 个答案:

没有答案