错误:必须为批处理请求指定[FBSDKSettings appID]

时间:2016-09-17 07:22:13

标签: ios swift facebook-graph-api facebook-ios-sdk

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FBSDKGraphRequestConnection: [FBSDKSettings appID] must be specified for batch requests'

尝试运行2个批处理请求时出现此错误。下面的代码显示了我所做的。我该如何解决这个问题?

   let requestForOSP =
        FBSDKGraphRequest(graphPath: FacebookParameters.OSP,
                          parameters: [ nil ],
                          httpMethod: "GET")

    let requestForMSA =
        FBSDKGraphRequest(graphPath: FacebookParameters.MSA,
                           parameters: [ nil ],
                          httpMethod: "GET")



   let connection = FBSDKGraphRequestConnection()

    connection.add(requestForOSP, completionHandler: { (connection, result, error) in

   // DO Stuff

  }


    connection.add(requestForMSA, completionHandler: { (connection, result, error) in

   // DO Other Stuff

  }

1 个答案:

答案 0 :(得分:0)

我解决了。

  1. 我必须在这里创建一个Facebook应用:https://developers.facebook.com/apps/

  2. 选择iOS idk,

  3. 获取应用编号

  4. 将其放入Xcode的plist文件