【发布时间】:2020-12-09 22:01:31
【问题描述】:
我能够在 Firebase 中获取当前用户的 uID。
我将图片的名称和网址保存在 firebase 数据库中。
我想将当前用户的所有图像 url 和图像名称仅保存在其 uID 的 1 个节点下。
fileReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri)
{
//Do what you want with the url
Upload upload = new Upload(filename,
fileURL);
mDatabaseRef.child(currentFirebaseUser.getUid()).setValue(upload);
Toast.makeText(MainActivity.this, "Upload successful", Toast.LENGTH_LONG).show();
}
});
【问题讨论】:
标签: android firebase-realtime-database firebase-authentication firebase-storage