Why am I getting com.facebook.sdk.login error 308?
For Xcode8 - iOS10,
Enable Keychain Sharing within Capabilities tab of target fixed my issue.
More details can be found here : https://github.com/facebook/facebook-sdk-swift/issues/51
For Xamarin Studio (Suggested by @Kenneth),
Add the Entitlements.plist file to Custom Entitlements under the iOS Bundle Signing
options in the iOS project.
iOS Parse Facebook Login error 308 FBSDKLoginBadChallengeString
Fixed it. This issue was caused by logging in with Parse and with FBSDKLoginButton
.
Here's what I was doing:
//in my UI setup code:
let fbLoginButton = FBSDKLoginButton()
fbLoginButton.addTarget(self, action: "fbButtonTouched:", forControlEvents: UIControlEvents.TouchUpInside)
....
func fbButtonTouched() {
let permissionsArray = ["public_profile", "email"]
PFFacebookUtils.logInInBackgroundWithReadPermissions(permissionsArray)
{ (user: PFUser?, error: NSError?) in
if let user = user {
//we logged in!
}
else {
//login error!
}
}
}
I found out (the hard way) that tapping a FBSDKLoginButton
attempts to log the user in! There was no need to also log the user in using PFFacebookUtils.logInInBackgroundWithReadPermissions
. So I just got rid of fbButtonTouched()
and I could happily log in.
So what happened was that I was attempting two logins at the same time, which the simulator was happy with, but not the device.
If you want to know why, it's because the login authentication challenge it received did not correspond to the one it was expecting because it received the one from the first log in attempt after it had sent the one from the second log in attempt and was therefore waiting for the second log in attempts' authentication challenge.
The documentation for FBSDKLoginButton
doesn't currently mention anything about the fact that tapping it initiates the log in flow, and because it's a subclass of UIButton
, you'd think that you ought to addTarget
to it and implement the login flow yourself. And having two logins at the same time leads to a misleading FBSDKLoginBadChallengeString
. Recipe for disaster...
EDIT: The documentation has been updated correspondingly:
FBSDKLoginButton
works with[FBSDKAccessToken currentAccessToken]
to determine what to display, and automatically starts authentication when tapped (i.e., you do not need to manually subscribe action targets).
(my emphasis)
Error: com.facebook.sdk.login error 308 in Xamarin.Form
I have resolved above error. I just followed this: https://www.c-sharpcorner.com/article/facebook-native-login-with-xamarin-forms/
Above article has example of facebook integration. We can also download project and run it as it given in that article.
So, what was the issue! The issue was my facebook.dll
or we can say SDK was older. I have updated it and updated info.plist
file as given in demo project that I have downloaded from above article. No change in code.
FBSDK Login Error Code: 308 in Objective-C
One solution, at least for me, is to not run on device via the Xcode debugger. If I run the app on device outside the debugger the Facebook login works fine. If I run the app in the sim via the debugger the Facebook login works fine.
Only if I run the app on device via the Xcode debugger do I get the com.facebook.sdk.login error 308 every time.
Xamarin Facebook iOS10 SDK com.facebook.sdk.login Code=308
Believe it or not, I found the solution to this error doing the opposite of what is described here: https://forums.xamarin.com/discussion/39673/iphonesimulator-build-results-in-no-valid-ios-code-signing-keys-found-in-keychain
Basically, go to the Project Options > iOS Bundle Signing and add the Entitlements.plist at the "Custom Entitlements" text box. It works!
-- Julio
(com.facebook.sdk.login error 304.) Error with FBSDK 4.2
It seems I was doing
[FBSDKAccessToken refreshCurrentAccessToken:^(FBSDKGraphRequestConnection *connection, id result, NSError *error){}
in a background thread during login operation. I removed that and It worked perfectly fine.
Related Topics
Supporting a Nsmanagedobject Fetchrequest() Class Method in iOS 9 and 10
Swiftui: How to Change the Tint Color (Background Color) of a Navigationview
Libmobilegestalt Mobilegestalt.C:890: Mgisdeviceoneoftype Is Not Supported on This Platform
Launch Watch App into Middle View
Blur Effect - Background Uitextfield
How to Use Nsuserdefaults to Store an Array of Custom Classes in Swift
Swift 3 Imessage Extension Doesn't Open Url
Why Doesn't iOS System Sound Play in Simulator
Present Specific View Controller in Didreceiveremotenotification with Swift
Getting Uiwebview API Deprecation Message After Adding Paypal Pod in My iOS App
iOS Swift Connect Wifi Programmatically and Distinguish Between Bad Password and No Wifi in Range
Gmsmarker Icon in the Top Left Corner of the View (Ios)
How to Auto Call an @Ibaction Function
Swift Sending Data from Child View to Parent View Controller