gpt4 book ai didi

ios - Parse 和 Facebook 的问题

转载 作者:行者123 更新时间:2023-11-30 14:18:50 25 4
gpt4 key购买 nike

我开始使用 Parse 和 Facebook 开发一个应用程序。我已经添加了这两个 SDK。

这是我的 ViewController 代码(fbLogIn 是“连接 Facebook”的按钮):

    class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func fbLogIn(sender: AnyObject) {
var permissions = ["email"]
PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) {
(user: PFUser?, error: NSError?) -> Void in
if let user = user {
if user.isNew {
println("User signed up and logged in through Facebook!")
} else {
println("User logged in through Facebook!")
}
} else {
println("Uh oh. The user cancelled the Facebook login.")
}
}
}}

这是应用程序委托(delegate)代码:

import UIKit
import Parse
import Bolts

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
Parse.setApplicationId("*Cencored ID*",
clientKey: "*Cencored clientkey*")
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)

return true
}

func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
FBSDKAppEvents.activateApp()
}

func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

func application(application: UIApplication,
openURL url: NSURL,
sourceApplication: String?,
annotation: AnyObject?) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application,
openURL: url,
sourceApplication: sourceApplication,
annotation: annotation)
}

}

这是错误: http://i.imgur.com/GZtyG3k.png

我可以做什么来修复它?

最佳答案

我也有过类似的经历。查看项目中的框架,检查是否有 ParseFacebookUtils.framework 和 ParseCrashReporting.framework。如果这样做,请将它们从您的项目中删除。不过,您需要 ParseFacebookUtilsV4.framework,因此请将其保留在那里。

关于ios - Parse 和 Facebook 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30760518/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com