Ios 解析链接/取消链接从未调用的用户完成块(Twitter/Facebook)
我正试图通过Parse iOS SDK为Twitter和Facebook添加链接/取消链接功能,但我遇到了一个以前从未遇到过的问题-链接和取消链接用户的完成块从未被调用。下面是我用于链接/取消链接功能的代码,我想知道是否有人以前遇到过类似的问题,可能对问题所在有什么想法。谢谢Ios 解析链接/取消链接从未调用的用户完成块(Twitter/Facebook),ios,swift,parse-platform,Ios,Swift,Parse Platform,我正试图通过Parse iOS SDK为Twitter和Facebook添加链接/取消链接功能,但我遇到了一个以前从未遇到过的问题-链接和取消链接用户的完成块从未被调用。下面是我用于链接/取消链接功能的代码,我想知道是否有人以前遇到过类似的问题,可能对问题所在有什么想法。谢谢 @IBAction func atnFacebookConnect(sender: AnyObject) { disableUserInteraction() self.actFacebookConnect
@IBAction func atnFacebookConnect(sender: AnyObject) {
disableUserInteraction()
self.actFacebookConnect.startAnimating()
let permissions = ["email","public_profile","user_about_me"]
if btnFacebookConnect.titleLabel?.text == "Disconnect" {
if let user = User.currentUser() {
PFFacebookUtils.unlinkUserInBackground(user, block: { (success, error) -> Void in
if error == nil && success == true {
self.checkIfUserIsLinkedToSocialMedia()
}
else {
iLikeyAlert(self, "", "Something went wrong", nil)
}
self.actFacebookConnect.stopAnimating()
self.enableUserInteraction()
})
}
}
else if btnFacebookConnect.titleLabel?.text == "Connect" {
if let user = User.currentUser() {
PFFacebookUtils.linkUserInBackground(user, withReadPermissions:permissions, block: { (success, error) -> Void in
if error == nil && success == true {
self.checkIfUserIsLinkedToSocialMedia()
}
else {
iLikeyAlert(self, "", "Something went wrong", nil)
}
self.actFacebookConnect.stopAnimating()
self.enableUserInteraction()
})
}
}
}
@IBAction func atnTwitterConnect(sender: AnyObject) {
disableUserInteraction()
self.actTwitterConnect.startAnimating()
if btnTwitterConnect.titleLabel?.text == "Disconnect" {
if let user = User.currentUser() {
PFTwitterUtils.unlinkUserInBackground(user, block: { (success, error) -> Void in
if error == nil && success == true {
self.checkIfUserIsLinkedToSocialMedia()
}
else {
iLikeyAlert(self, "", "Something went wrong", nil)
}
self.actTwitterConnect.stopAnimating()
self.enableUserInteraction()
})
}
}
else if btnTwitterConnect.titleLabel?.text == "Connect" {
if let user = User.currentUser() {
PFTwitterUtils.linkUser(user, block: { (success, error) -> Void in
if error == nil && success == true {
self.checkIfUserIsLinkedToSocialMedia()
}
else {
iLikeyAlert(self, "", "Something went wrong", nil)
}
self.actTwitterConnect.stopAnimating()
self.enableUserInteraction()
})
}
}
}