我已经在android应用程序中集成了socialauth。
但问题是,当我给我的facebook应用程序id和密钥时,它无法从graph.facebook.com获取信息。
当我给其他facebook应用程序ID (例如: SocialAuth.in)时,它工作得很好。可能的问题是什么?
我的Logcat如下:
02-14 11:02:34.258: W/System.err(1358): org.brickred.socialauth.exception.SocialAuthException: Error while getting profile from https://graph.facebook.com/me
02-14 11:02:34.258: W/System.err(1358): at org.brickred.socialauth.provider.FacebookImpl.authFacebookLogin(FacebookImpl.java:205)
02-14 11:02:34.268: W/System.err(1358): at org.brickred.socialauth.provider.FacebookImpl.doVerifyResponse(FacebookImpl.java:192)
02-14 11:02:34.268: W/System.err(1358): at org.brickred.socialauth.provider.FacebookImpl.verifyResponse(FacebookImpl.java:178)
02-14 11:02:34.268: W/System.err(1358): at org.brickred.socialauth.SocialAuthManager.connect(SocialAuthManager.java:184)
02-14 11:02:34.268: W/System.err(1358): at org.brickred.socialauth.android.SocialAuthDialog$SocialAuthWebViewClient$1.run(SocialAuthDialog.java:246)
02-14 11:02:34.268: W/System.err(1358): at java.lang.Thread.run(Thread.java:841)
02-14 11:02:34.278: W/System.err(1358): Caused by: java.io.FileNotFoundException: https://graph.facebook.com/me?access_token=CAAD2WcZBnsZBQBAJ3hOeUWx1JnBY0XpAyOadslebo8H4OM5bZAhysrYYEHU2WynddlR9bQx02I52FHUJGMMd1MA88PUOOD2NBYi2P4qQL7mVxtp9QZCkTFvDvgyZB8ELwWs7xIsCCgrJZCy5cx6ZAwRwpHOzaU5umoKIk3HQrZA5vq80wOYBQvTol72a4k7YtSwZD
02-14 11:02:34.278: W/System.err(1358): at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:186)
02-14 11:02:34.278: W/System.err(1358): at libcore.net.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:271)
02-14 11:02:34.288: W/System.err(1358): at org.brickred.socialauth.util.Response.getResponseBodyAsString(Response.java:103)
02-14 11:02:34.288: W/System.err(1358): at org.brickred.socialauth.provider.FacebookImpl.authFacebookLogin(FacebookImpl.java:203)
02-14 11:02:34.288: W/System.err(1358): ... 5 more
02-14 11:02:34.288: D/SocialAuthError(1358): org.brickred.socialauth.exception.SocialAuthException: Error while getting profile from https://graph.facebook.com/me
02-14 11:02:34.288: D/Custom-UI(1358): Error
02-14 11:02:34.288: W/System.err(1358): org.brickred.socialauth.android.SocialAuthError: Unknown Error
02-14 11:02:34.298: W/System.err(1358): at org.brickred.socialauth.android.SocialAuthDialog$SocialAuthWebViewClient$1.run(SocialAuthDialog.java:262)
02-14 11:02:34.298: W/System.err(1358): at java.lang.Thread.run(Thread.java:841)发布于 2014-04-01 18:38:24
解决了这个问题。你必须把你自己的
#facebook
graph.facebook.com.consumer_key = xxxxxxxxxxxxxxxxxxxxxx
graph.facebook.com.consumer_secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxx来自您的应用程序,位于auth_consumer.propertie的资源文件中。
第一是FACEBOOK_APP_ID,第二是FACEBOOK_API_SECRET
https://stackoverflow.com/questions/21771562
复制相似问题