无法访问Facebook会话 - UnknownError:无效的应用程序 [英] Can not access Facebook session - UnknownError: Invalid application

查看:1446
本文介绍了无法访问Facebook会话 - UnknownError:无效的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Prime31 SocialNetworking插件Unity3D与Facebook SDK 3.5和尝试登录的Facebook在Android 2.3.5设备上。 Facebook的应用程序安装在我的设备上的Facebook用户登录之前,应用程序启动。默认的登录行为 SSO_WITH_FALLBACK 被使用。

I'm using Prime31 SocialNetworking plugin for Unity3D with Facebook SDK 3.5 and trying to login Facebook on the Android 2.3.5 device. Facebook application is installed on my device and a Facebook user is logged in prior to application launch. Default login behaviour SSO_WITH_FALLBACK is used.

当我开始从我的应用程序登录我遵守以下行为:

When I initiate a login from my application I observe the following behaviour:

  1. 当应用程序启动Facebook的会议是在创建的状态。
  2. 在权限对话框提示我允许我的应用程序基本的读访问。
  3. 在我点击确定,然后我的主要应用程序的活动显示,而不是Facebook的登录对话框(也许是故意的,但 Session.getActiveSession()。closeAndClearTokenInformation() Session.setActiveSession(空)被称为前新Session.OpenRequest(FacebookPlugin.getActivity()) Prime31插件内)。
  4. 在我的应用程序的Facebook会话没有打开(在 CLOSED_LOGIN_FAILED 状态)。
  1. When the application starts the Facebook session is in CREATED state.
  2. A permissions dialog prompts me to allow basic read access for my application.
  3. I click OK and then my main application activity is shown instead of Facebook's login dialog (maybe it's intentional but Session.getActiveSession().closeAndClearTokenInformation() and Session.setActiveSession(null) are called prior to new Session.OpenRequest(FacebookPlugin.getActivity()) inside Prime31 plugin).
  4. My application's Facebook session is not opened (is in CLOSED_LOGIN_FAILED state).

在logcat的报告我这行(包名称和Facebook应用程序ID将被替换):

The logcat reports me these lines (package name and Facebook app ID are replaced):

I/Prime31 ( 5077): FacebookPlugin: openActiveSession.call with state: CLOSED_LOGIN_FAILED, exception: com.facebook.FacebookException: Log in attempt aborted.
I/Prime31 ( 5077): session state: OPENING
I/ActivityManager( 1444): Starting activity: Intent { act=SSO_WITH_FALLBACK cmp=MY_PACKAGE_NAME/com.facebook.LoginActivity (has extras) } from pid 5077
I/Prime31 ( 5077): FacebookPlugin: openActiveSession.call with state: OPENING, exception: null
V/ActivityManager( 1444): Checking to restart com.facebook.LoginActivity: changed=0x0, handles=0x0
V/ActivityManager( 1444): oldConfig={ scale=1.0 imsi=250/2 loc=ru_RU touch=3 keys=1/1/2 nav=1/1 orien=1 layout=34 uiMode=17 seq=3 skin=default fontsize=3}
V/ActivityManager( 1444): newConfig={ scale=1.0 imsi=250/2 loc=ru_RU touch=3 keys=1/1/2 nav=1/1 orien=1 layout=34 uiMode=17 seq=3 skin=default fontsize=3}
V/WindowManager( 1444): Finished animation in AppWindowToken{40e61148 token=HistoryRecord{408389c8 MY_PACKAGE_NAME/com.prime31.UnityPlayerNativeActivity}} @ 6621760
I/ActivityManager( 1444): Displayed MY_PACKAGE_NAME/com.facebook.LoginActivity: +547ms
V/WindowManager( 1444): Finished animation in AppWindowToken{40c836a8 token=HistoryRecord{40d3d640 MY_PACKAGE_NAME/com.facebook.LoginActivity}} @ 6621760
D/NativeCrypto( 3576): returned from sslSelect() with result 1, error code 2
W/fb4a(:<default>):BlueServiceQueue( 3576): Exception during service
W/fb4a(:<default>):BlueServiceQueue( 3576): com.facebook.http.protocol.ApiException: Invalid application MY_VALID_APP_ID
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.http.protocol.ApiResponseChecker.b(ApiResponseChecker.java:81)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.http.protocol.ApiResponseChecker.a(ApiResponseChecker.java:110)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.http.protocol.ApiResponse.h(ApiResponse.java:291)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:272)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:29)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.http.protocol.SingleMethodRunnerImpl.a(SingleMethodRunnerImpl.java:152)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.http.protocol.AbstractSingleMethodRunner.a(AbstractSingleMethodRunner.java:16)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.katana.server.handler.PlatformOperationHandler.c(PlatformOperationHandler.java:366)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.katana.server.handler.PlatformOperationHandler.a(PlatformOperationHandler.java:259)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:293)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:53)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.fbservice.service.BlueServiceQueue$3.run(BlueServiceQueue.java:230)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:444)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at com.facebook.common.executors.HandlerExecutorServiceImpl$ListenableScheduledFuture.run(HandlerExecutorServiceImpl.java:268)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at android.os.Handler.handleCallback(Handler.java:587)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at android.os.Handler.dispatchMessage(Handler.java:92)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at android.os.Looper.loop(Looper.java:150)
W/fb4a(:<default>):BlueServiceQueue( 3576):     at android.os.HandlerThread.run(HandlerThread.java:60)
W/Bundle  ( 5077): Key com.facebook.platform.protocol.PROTOCOL_VERSION expected String but value was a java.lang.Integer.  The default value <null> was returned.
W/Bundle  ( 5077): Attempt to cast generated internal exception:
W/Bundle  ( 5077): java.lang.ClassCastException: java.lang.Integer
W/Bundle  ( 5077):      at android.os.Bundle.getString(Bundle.java:1040)
W/Bundle  ( 5077):      at android.content.Intent.getStringExtra(Intent.java:3685)
W/Bundle  ( 5077):      at com.facebook.AuthorizationClient$KatanaLoginDialogAuthHandler.tryAuthorize(AuthorizationClient.java:821)
W/Bundle  ( 5077):      at com.facebook.AuthorizationClient.tryCurrentHandler(AuthorizationClient.java:272)
W/Bundle  ( 5077):      at com.facebook.AuthorizationClient.tryNextHandler(AuthorizationClient.java:238)
W/Bundle  ( 5077):      at com.facebook.AuthorizationClient$GetTokenAuthHandler.getTokenCompleted(AuthorizationClient.java:772)
W/Bundle  ( 5077):      at com.facebook.AuthorizationClient$GetTokenAuthHandler$1.completed(AuthorizationClient.java:731)
W/Bundle  ( 5077):      at com.facebook.internal.PlatformServiceClient.callback(PlatformServiceClient.java:144)
W/Bundle  ( 5077):      at com.facebook.internal.PlatformServiceClient.handleMessage(PlatformServiceClient.java:128)
W/Bundle  ( 5077):      at com.facebook.internal.PlatformServiceClient$1.handleMessage(PlatformServiceClient.java:54)
W/Bundle  ( 5077):      at android.os.Handler.dispatchMessage(Handler.java:99)
W/Bundle  ( 5077):      at android.os.Looper.loop(Looper.java:150)
W/Bundle  ( 5077):      at android.app.ActivityThread.main(ActivityThread.java:4385)
W/Bundle  ( 5077):      at java.lang.reflect.Method.invokeNative(Native Method)
W/Bundle  ( 5077):      at java.lang.reflect.Method.invoke(Method.java:507)
W/Bundle  ( 5077):      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
W/Bundle  ( 5077):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
W/Bundle  ( 5077):      at dalvik.system.NativeStart.main(Native Method)

当我从Facebook注销内的本机应用程序的行为稍有变化 - 出现的登录画面,但主要的应用程序活动显示,当我得到同样的 CLOSED_LOGIN_FAILED 会话状态

When I logout from Facebook within the native app the behaviour slightly changes - the login screen appears, but when the main application activity is shown I get the same CLOSED_LOGIN_FAILED session state.

我检查我的应用程序ID和散列键在Facebook应用程序设置:两者都匹配我的应用程序的设置。通过Prime31插件logcatted哈希键是一样的在我的Windows环境现状已创建。当我改变了应用程序ID不同的东西我得到了另一个错误 - 无效的应用程序ID。因此,应用程序ID似乎是正确设置。还有什么我可能会错过?

I've checked my application ID and hash key in the Facebook app settings: both are matching to my app's settings. Hash key logcatted by Prime31 plugin is the same as was created on my Windows evironment. When I changed app ID to something different I got another error - "invalid app id". So app id seems to be set up correctly. What else I might miss?

推荐答案

对于所有谁遇到类似的问题,检查您的 Facebook应用程序沙箱模式目前活跃的Facebook用户。以我为例,我开始这是在沙盒模式和当前的 Facebook的用户是不是从用户的Facebook应用程序设置

For all who encounter similar issues check your Facebook application sandbox mode and currently active Facebook user when starting your application. In my case I was starting the application which was in the sandbox mode and the current Facebook user was not from the granted list of users in the Facebook application settings.

这篇关于无法访问Facebook会话 - UnknownError:无效的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆