swift - Use Parse.com Data in iOS 8 Notification Center widget -
I am trying to download some strings from parse.com inside the Notification Center widget.
That's why I need to first need to first load credentials to sign in to parse the user, which is the NSUserDefaults
(I know about the security aspect.) The app has been saved. This step works fine, but when I follow the following code, the widget says it is not possible to load the data.
func signUserIn (username: string, password: string) {PFUser.logInWithUsernameInBackground (username, password: password) {(user: pfusor !, error: nsERr!) - & gt; If in zero (user! = Zero) {SMKeychainService.saveToken (password) var defaults = NSUserDefaults (suiteName: "group.xxx.xxx") defaults.setObject (user name, for: "username") defaults.synchronize () Self. Have you tried to load data from parse.com inside one of you? Widget and how did you do it? I can not even load the data, because as I mentioned widget crash on the user's sign-in.
There is no problem signing in to pars and load data with the app. I resolved the problem
I did not implement the Parse.setApplicationId ("xxx", clientKey: "xxx")
, now I have implemented viewDidLoad
and the code works!
Setting
Parse.setApplicationId (APID, Client Key: Clientkey)
Extensions for the extension does not work. Use this code in the viewdial load of the extension and it works fine.
Comments
Post a Comment