我似乎无法找出此错误的有效解决方案,更完整:
018-06-01 10:33:09 PM [错误] WebSocket: ws_0 - 无法连接 System.Net.Sockets.SocketException (0x80004005):没有到主机的路由
2018-06-01 10:33:09 PM [错误] WebSocket:ws_0 -握手期间的 WebSocketException Firebase.Database.Internal.TubeSock.WebSocketException:未知主机:########.firebaseio.com ---> System.Net.Sockets.SocketException:没有到主机的路由
请注意,上述错误每秒重复几次,每次 ws_# 递增 1
统一 2018.1.1f1
Firebase-Database:无论是最新的,都在几天前得到
代码位:
void Start() {
FirebaseApp.LogLevel = LogLevel.Verbose;
FirebaseDatabase.DefaultInstance.LogLevel = LogLevel.Verbose; // Or your database instance, if not using the default.
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
var dependencyStatus = task.Result;
if (dependencyStatus == Firebase.DependencyStatus.Available) {
FirebaseApp app = FirebaseApp.DefaultInstance;
// NOTE: You'll need to replace this url with your Firebase App's database
// path in order for the database connection to work correctly in editor.
app.SetEditorDatabaseUrl("https://########.firebaseio.com/");
if (app.Options.DatabaseUrl != null) app.SetEditorDatabaseUrl(app.Options.DatabaseUrl);
} else {
Debug.LogError(System.String.Format(
"Could not resolve all Firebase dependencies: {0}", dependencyStatus));
// Firebase Unity SDK is not safe to use here.
}
});
}
下面是我尝试访问 firebase 数据库
DatabaseReference mDatabaseRef = FirebaseDatabase.DefaultInstance.RootReference;
staticLocalData.thisUser = new UserData();
staticLocalData.thisUser.userID = newUser.UserId;
staticLocalData.thisUser.email = email;
staticLocalData.thisUser.firstName = firstName;
staticLocalData.thisUser.lastName = lastName;
registerData temp = new registerData();
temp.firstName = firstName;
temp.lastName = lastName;
temp.email = email;
temp.userName = userName;
慕妹3242003
相关分类