2011-06-10 3 views
3

Je développe une application iPhone qui traite de Facebook. J'utilise le dernier SDK facebook-facebook-ios-sdk-cf1c2c3 (SDK 2.0) pour permettre à l'utilisateur de se connecter à un compte Facebook en utilisant OAuth.Facebook OAuth problème de connexion avec Facebook SDK 2.0

L'utilisateur peut se connecter sans aucun problème à l'appareil iPod Touch (4.3.1). Mais dans l'iPhone 3GS-je obtenir l'erreur suivante:

Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be \u201cm.facebook.com\u201d which could put your confidential information at risk." UserInfo=0x1b8350 {NSErrorFailingURLStringKey=https://m.facebook.com/dialog/oauth?type=user_agent&display=touch&redirect_uri=fbconnect://success&sdk=2&scope=read_stream,publish_stream&client_id=<APP_ID>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSErrorFailingURLKey=https://m.facebook.com/dialog/oauth?type=user_agent&display=touch&redirect_uri=fbconnect://success&sdk=2&scope=read_stream,publish_stream&client_id=<APP_ID>, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be \u201cm.facebook.com\u201d which could put your confidential information at risk., NSUnderlyingError=0x1b83a0 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be \u201cm.facebook.com\u201d which could put your confidential information at risk.", NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x1be310>} 


I extracted the URL from the FBLoginDailog and tried loading it in iPhone -> Safari. It redirects to the following URL and allows the user to login: 

http://m.facebook.com/login.php?app_id=<APP_ID>&sdk=2&cancel=fbconnect://success?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request.&fbconnect=1&next=https://www.facebook.com/connect/uiserver.php?method=permissions.request&app_id=<APP_ID>&display=touch&redirect_uri=fbconnect;//success&sdk=2&type=user_agent&fbconnect=1&perms=read_stream,publish_stream&from_login=1&rcount=1 

Aussi, j'ai trouver la solution suivante à partir du lien: https://github.com/facebook/facebook-ios-sdk/issues/139

Mais, le lien mentionne aussi de ne pas l'utiliser pour exécutable App Store. Mais, je reçois aussi le problème pour l'application de magasin d'applications.

Comment résoudre ce problème?

Merci et salutations, Deepa

Répondre

10

Ce problème n'a pas été SDK. La date et l'heure définies dans Device (3GS) étaient incorrectes.

+0

merci pour la réponse! J'essayais en fait de comprendre pourquoi l'iPhone 3G de mon ami ne se connecterait pas à Facebook. Il a produit cette erreur 1202. Googling n'a pas aidé, mais stackoverflow a fait! Merci! +1 – gonzobrains