當嘗試我的Android手機上進行測試期間登錄到我的web應用程序,我得到這個消息:使用與Facebook火力權威性
「firebase.js:75未捕獲的錯誤:該操作未在環境中支持此「location.protocol」必須是http或https ..「
我將我的firebase url添加到我的fb應用上的有效OAuth重定向URI - https://.firebaseio.com/我添加了我的應用ID和名稱到身份驗證部分的Firebase。我錯過了什麼嗎?感謝
我在這裏使用Chrome遠程調試:文件:///android_asset/www/index.html#/app/people
難道這是爲什麼它把一個大驚小怪的?
var provider = new firebase.auth.FacebookAuthProvider();
console.log(provider);
firebase.auth().signInWithPopup(provider).then(function(result) {
// This gives you a Facebook Access Token. You can use it to access theFacebook API.
var token = result.credential.accessToken;
// The signed-in user info.
var user = result.user;
console.log(user, token);
UserService.setUser(user, token);
// ...
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// The email of the user's account used.
var email = error.email;
// The firebase.auth.AuthCredential type that was used.
var credential = error.credential;
console.log(errorCode);
});
認證將無法正常工作用'file://'。您需要從適當的Web服務器加載HTML以使其正常工作。 –
是的。我是這麼想的。即時通訊使用輕量級輕量級adb在我的手機上運行應用程序。也許,我可以以某種方式從節點上運行它。有什麼建議麼?謝謝。 –
只是啓動本地服務器。有很多節點模塊,只需在npm上搜索即可。 – luschn