【发布时间】:2017-12-24 04:12:56
【问题描述】:
我已经在我的 Moto G5+(有效)和 Nexus 6(无效)上对此进行了测试,而我的 firebase 身份验证仅适用于其中之一:
mAuth = FirebaseAuth.getInstance();
if(mAuth.getCurrentUser() == null) { //No existing user
mAuth.signInAnonymously().addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.v("myTag", "Cannot authenticate user" + e);
}
});
}
if(mAuth.getCurrentUser() != null) {
Log.v("myTag", "Boutta take photos");
takePhoto(this, 0);//back camera
}else{
Log.v("myTag", "Cannot take photos, user not authenticated");
}
奇怪的是我只得到了日志Cannot take photos, the user not authenticated,却没有得到日志Cannot authenticate user。这意味着我可以对用户进行身份验证,但由于某种原因,它不起作用
为什么这只适用于某些设备?
【问题讨论】:
-
模拟器上有 Nexus 6 吗?
-
@martinomburajr 不,这是真的
标签: android algorithm security firebase authentication