android - Android facebook登录 - 卡在加载中
问题描述
我按照本教程提供 facebook 登录:https ://developers.facebook.com/docs/facebook-login/android/v2.2
我的代码中的所有内容都是相同的,并且在我拥有的所有测试设备上都运行良好。
刚刚收到设备三星 A5 - android 6.0.1 登录卡住的问题。
问题的流程是: 1. facebook 登录成功 2. 注销成功(LoginManager.getInstance().logOut(); 被调用) 3. 返回到 LoginActivity 4. 第二次尝试从 LoginActivity 进行 facebook 登录不成功,用户卡在登录屏幕上,如下面的屏幕截图所示。
我在这里发现了许多与 Facebook 登录卡住有关的问题。但是他们中的大多数人没有答案,或者他们的答案对我不起作用。
是什么导致了这个问题?为什么它可以在除此之外的所有设备上运行?有任何想法吗?
回调注册:
callbackManager = CallbackManager.Factory.create();
facebookLoginButton = findViewById(R.id.login_button);
facebookLoginButton.setReadPermissions(Arrays.asList(EMAIL));
facebookLoginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
//success
}
@Override
public void onCancel() {
//cancel
}
@Override
public void onError(FacebookException exception) {
//error
}
});
活动结果(但我没有到达那里):
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 64206) {
callbackManager.onActivityResult(requestCode, resultCode, data);
}
}
Logcat 没有显示任何错误。这是我点击 facebook 登录按钮后得到的日志:
D/ViewRootImpl: ViewPostImeInputStage processPointer 0
D/ViewRootImpl: ViewPostImeInputStage processPointer 1
D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{7fbde01 V.E...... R.....I. 0,0-0,0}
I/Timeline: Timeline: Activity_launch_request id: time:15401189
V/FA: Recording user engagement, ms: 4184
V/FA: Activity paused, time: 15401224
D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
V/FA: onActivityCreated
D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=4184, firebase_screen_class(_sc)=LoginActivity, firebase_screen_id(_si)=-xxx}]
D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=LoginActivity, firebase_previous_id(_pi)=-xxx, firebase_screen_class(_sc)=FacebookActivity, firebase_screen_id(_si)=-xxx}]
D/SecWifiDisplayUtil: Metadata value : none
D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{a06ce06 V.E...... R.....I. 0,0-0,0}
D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{64fbcc7 I.E...... R.....I. 0,0-0,0}
V/FA: Activity resumed, time: 15401264
D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{5b65b7 V.E...... R.....I. 0,0-0,0}
D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 48 - 0, 0) vi=Rect(0, 48 - 0, 0) or=1
MSG_RESIZED_REPORT: ci=Rect(0, 48 - 0, 0) vi=Rect(0, 48 - 0, 0) or=1
D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
V/FA: Inactivity, disconnecting from the service
解决方案
推荐阅读
- wordpress - 忘记密码需要从 wp-login 重定向到自定义页面
- json - 完成此操作所需的数据不可用错误
- oracle - 选择查询返回“零”记录时如何处理游标异常
- python - `tf.keras.Model.compile` 在 TF2.0 中有什么作用?
- java - 我需要从列表标签内的 json 脚本中获取数据
- node.js - Inversify - Nodejs- 容器绑定导致超出最大调用大小
- jsp - 如何检查对 index.ftl 的 HTTP 请求?
- python - 是否可以在 Pandas.ReadSQL 中使用“chunksize=”选项来限制/限制内存/RAM 的使用?
- reactjs - rc-滑块图标或 html 标签
- python - 我在 python 3.6 中安装 webdrive 模块时遇到问题