admin管理员组

文章数量:1291091

protected suspend fun uploadProfileImage(userId: String, imageUri: Uri): String {
    val fileRef = storage.reference.child("profile_images/$userId.jpg")
    fileRef.putFile(imageUri).await()
    return fileRef.downloadUrl.await().toString()
}

protected suspend fun uploadExamImage(userId: String, imageUri: Uri, index: String): String {
    val fileRef = storage.reference.child("exam_images/$userId/image_${index}_$imageUri.jpg")
    fileRef.putFile(imageUri).await()
    return fileRef.downloadUrl.await().toString()
}

Here, I'm trying to upload images to Firebase Storage. But before that, I had already written my whole project natively, and now I want to migrate. However, I'm facing this issue because Uri was imported like this: import android.Uri, so I can't use it, because I don't know how to import it in Compose Multiplatform.

本文标签: