我已將Parse Framework與所有Facebook依賴項集成到我的應用中。 我的plist配置是這樣的:IOS 9 Swift - 解析Facebook登錄無法打開本地Facebook應用
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fbXXXXXXXXXXXXX</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>XXXXXXXXXXXXX</string>
<key>FacebookDisplayName</key>
<string>XXXXX</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>facebook.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>fbcdn.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>akamaihd.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbauth2</string>
</array>
我登錄的代碼看起來像這樣:
PFFacebookUtils.logInInBackgroundWithReadPermissions(permissionsArray, block: { (user, error) -> Void in
if(error != nil){
print("Login failed")
}else{
if let currentUser = user{
if(currentUser.isNew){
print("New user")
}else{
print("Login success")
}
}else{
print("Login canceled")
}
}
})
一切運作良好,但是在登錄過程中的Safari瀏覽器正在做的,而不是在安裝Facebook應用。
我錯過了什麼?
試試這個:http://stackoverflow.com/questions/33315083/error-in-facebook-login-ios-9-swift – lukaivicev