0

我想为我的应用程序获取用户访问令牌以访问登录用户的照片等。我创建了一个登录按钮,如 facebook android SDK 教程中给出的那样。我可以获得在 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)
4

1 回答 1

2

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

于 2013-05-03T02:23:50.653 回答