Facebook原生Android API会为非管理员用户生成错误

时间:2013-05-03 01:43:30

标签: android facebook facebook-graph-api facebook-android-sdk

我想为我的应用程序获取用户访问令牌以访问登录用户的照片等。我在facebook android SDK教程中创建了login button。我可以获得我的管理员帐户的访问令牌,该帐户在Facebook上创建了这个应用程序。

但是当我使用任何其他帐户登录时,它会抛出以下异常:

我不明白我做错了什么。理想情况下,所有其他人都应该能够登录此应用程序。我在模拟器上测试它。这可能是个问题吗?

05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): Exception during service
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): com.facebook.orca.protocol.base.ApiException: Invalid application 332039450257790
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.orca.protocol.base.ApiResponseChecker.b(ApiResponseChecker.java:74)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.orca.protocol.base.ApiResponseChecker.a(ApiResponseChecker.java:103)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.orca.protocol.base.ApiResponse.g(ApiResponse.java:208)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:267)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:28)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.orca.protocol.base.SingleMethodRunner.a(SingleMethodRunner.java:125)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.katana.server.handler.PlatformOperationHandler.c(PlatformOperationHandler.java:274)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.katana.server.handler.PlatformOperationHandler.a(PlatformOperationHandler.java:175)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.orca.server.OrcaServiceQueue.d(OrcaServiceQueue.java:218)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.orca.server.OrcaServiceQueue.d(OrcaServiceQueue.java:38)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at com.facebook.orca.server.OrcaServiceQueue$3.run(OrcaServiceQueue.java:169)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at android.os.Handler.handleCallback(Handler.java:587)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at android.os.Handler.dispatchMessage(Handler.java:92)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at android.os.Looper.loop(Looper.java:123)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352):    at android.os.HandlerThread.run(HandlerThread.java:60)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): Failed to send
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): com.facebook.orca.ops.ServiceException: API_ERROR: API_ERROR
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at com.facebook.orca.ops.OrcaServiceOperation.c(OrcaServiceOperation.java:610)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at com.facebook.orca.ops.OrcaServiceOperation.c(OrcaServiceOperation.java:40)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at com.facebook.orca.ops.OrcaServiceOperation$2.run(OrcaServiceOperation.java:575)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at android.os.Handler.handleCallback(Handler.java:587)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at android.os.Handler.dispatchMessage(Handler.java:92)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at android.os.Looper.loop(Looper.java:123)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at android.app.ActivityThread.main(ActivityThread.java:4627)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at java.lang.reflect.Method.invokeNative(Native Method)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at java.lang.reflect.Method.invoke(Method.java:521)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352):   at dalvik.system.NativeStart.main(Native Method)

1 个答案:

答案 0 :(得分:2)

实际上在应用创建过程中,我错误地选择了“沙盒”模式,该模式限制了应用只能访问应用配置页面中添加的开发人员。因此,在禁用此模式后,我也能够为其他用户生成访问令牌。