简体   繁体   English

从 firebase 获取当前登录的用户数据以及个人资料图片

[英]get current logged in user data from firebase along with profile picture

I have a registered user in firebase and want to get the current logged in user profile data along with his profile picture.我在 firebase 中有一个注册用户,想要获取当前登录的用户个人资料数据以及他的个人资料图片。 I'm able to get its name, number and other details but I'm not able to get profile picture which I have stored in firebase storage.我能够获得它的名称、号码和其他详细信息,但无法获得我存储在 firebase 存储中的个人资料图片。

在此处输入图片说明

It is very unlikely that Firebase can read a Uri.class from the database. Firebase 不太可能从数据库中读取Uri.class More likely you'll want to:您更有可能想要:

  1. Read the value from the database as a string.从数据库中以字符串形式读取值。
  2. Convert that to a URI in your code.将其转换为代码中的 URI。

So:所以:

String url = snapshot.child("profilePicture").getValue(String.class);
Uri myimageValue = Uri.parse(url);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM