我一直在浏览Firebase文档,在我的Android应用程序中设置用户身份验证系统.但是出于某种原因,它看起来并不像我的FirebaseAuth对象上运行任何回调!
例如,按照此处的说明设置Facebook身份验证
private void handleFacebookAccessToken(AccessToken token) {
Log.d("AUTH", "handleFacebookAccessToken:" + token.getToken());
// ...
AuthCredential credential = FacebookAuthProvider.getCredential(token.getToken());
Log.d("AUTH", "Credential: "+credential);
mAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
Log.d("AUTH", "signInWithCredential:onComplete:" + task.isSuccessful());
// If sign in fails, display a message to the user. If sign in succeeds
// the auth state listener will be notified and logic to handle the
// signed in user can be handled in the listener.
if (!task.isSuccessful()) {
Log.w("AUTH", …
Run Code Online (Sandbox Code Playgroud) 我有一个由Express提供的简单的Angular 4项目.当我尝试使用Googlebot抓取我的网站时,它只显示了一个空白页面(AppRoot的innerHTML).我以为谷歌声称它的机器人支持Angular 4/JS网站?
如果这仍然是问题,使用Angular Universal的服务器端渲染真的是最好的解决方案吗?就像我必须设置另一台服务器端服务器,除了服务于普通客户端呈现应用程序的主服务器之外,还提供服务器端渲染应用程序?如果是的话,我如何告诉googlebot转到服务器端呈现的应用程序的端口和普通的http流量转到客户端呈现的应用程序的端口?抓取器不是http流量吗?
目前我正在使用casper.evaluate函数执行类似的操作(使用CoffeeScript)
bool = casper.evaluate ->
document.querySelector('button selector').checked
Run Code Online (Sandbox Code Playgroud)
这似乎工作正常,但我想知道是否有一个内置的casper方法,我可以用来检索复选框/无线电元素的checked属性?我尝试过使用getElementAttribute()
但它不会检测到'已检查'作为属性.它也没有列在从中检索的JSON对象中getElementInfo()
.