设置在Unity中运行的个人资料图片(PhotoUrl),但不在Android版本中

时间:2017-12-11 17:38:18

标签: android firebase unity3d

我是Firebase的新手,几天来一直在努力解决这个问题,我真的很感激一些帮助。

我正在设置新帐户的DisplayName和PhotoUrl属性,然后立即在控制台中检索它们。在Unity中一切正常

当我执行Debug.Log()时,此代码返回用户名和Uri,但一旦构建logcat告诉我DisplayName已正确设置,但PhotoUrl为空:

	public void UpdateUser()
	{
		user = auth.CurrentUser;

		if (user != null) {
		Firebase.Auth.UserProfile profile = new Firebase.Auth.UserProfile {
			DisplayName = "Jane Q. User",
			PhotoUrl = new System.Uri("https://randomuser.me/api/portraits/men/95.jpg")
		};
		user.UpdateUserProfileAsync(profile).ContinueWith(task => {
			if (task.IsCanceled) {
			    Debug.LogError("UpdateUserProfileAsync was canceled.");
			    return;
			}
			if (task.IsFaulted) {
			    Debug.LogError("UpdateUserProfileAsync encountered an error: " + task.Exception);
			    return;
			}
			User = auth.CurrentUser;
			Debug.Log(user.DisplayName);
			Debug.Log(user.PhotoUrl);

			Debug.Log("User profile updated successfully.");

			userProfile.GetProfile();
		});
	}

很抱歉,如果我错过了文档中的内容,我确实在搜索答案,但我只是空手而归,而且我没有错误来表明问题。非常感谢任何想法!

谢谢,

罗布

0 个答案:

没有答案