मैं पार्स पाने के लिए मेरे एप्लिकेशन (सभी तेज) पर काम कर रहा पुश सूचनाएं कोशिश कर रहा हूँ, लेकिन लागू करने की कोशिश करते हुए, मैं त्रुटि '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!) {
UIApplication.sharedApplication().registerForRemoteNotifications()
}
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
var currentInstallation: PFInstallation = PFInstallation()
currentInstallation.setDeviceTokenFromData(deviceToken)
currentInstallation.saveInBackground()
println("got device id! \(deviceToken)")
}
func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
println(error.localizedDescription)
println("could not register: \(error)")
}
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
PFPush.handlePush(userInfo)
}
जब मैं बदल currentInstallation.saveInBackground
currentInstallation.saveEvenutally()
करने के लिए, कोड ठीक संकलित ..
लेकिन जब सफलतापूर्वक पुश नोटिफिकेशन के लिए साइन अप करने की कोशिश कर, एक त्रुटि कंसोल कह Error: deviceType must be specified in this operation (Code: 135, Version: 1.4.2)
मैं में पॉप अप होता है इसने इसे समझने के लिए घंटों बिताए हैं, कोई पासा नहीं, किसी भी मदद की सराहना की है।
यह अभी भी मेरे लिए इसे ठीक नहीं करता है :(, यह + var currentInstallation: PFInstallation = PFInstallation कर रहा है।currentInstallation() ने – yoshyosh
आयात किया बोल्ट ' यह –