将DownloadUrl从图像设置为Firestore字段

时间:2019-08-01 11:42:07

标签: android firebase google-cloud-firestore firebase-storage

我想将我的图片中的DownloadUrl放入Firestore字段中。我在Firestore中创建了一个字段,但只有一个Url,如下所示: 文件:///data/user/0/com.example.testapp/cache/cropped1623129957.jpg

那是我需要从存储中下载DownloadUrl的问题,这是这样的:

https://firebasestorage.googleapis.com/v0/b/testa-288ab.appspot.com/o/profile_images%.......jpg

有人可以帮助我吗?

timeStop <- "22:45:20"
trick <- reactiveValues()
trick$catch <- FALSE

  observe({
    invalidateLater(200, session)
    if (strftime(Sys.time(),  format="%H:%M:%S") > timeStop) {
      trick$toFire <- "after"
    } else if (strftime(Sys.time(),  format="%H:%M:%S") < timeStop){
      trick$toFire <- "before"
    } else if(strftime(Sys.time(),  format="%H:%M:%S") == timeStop & trick$catch == FALSE){
      trick$toFire <- "exact"  
}
  })

  observe({
    invalidateLater(200, session)
    if (trick$toFire == "exact") {
           trick$toFire <- "after"
            trick$catch <- TRUE
            Sys.sleep(1)
          #your code or functions
            trick$catch <- FALSE
        } 
  }) 

0 个答案:

没有答案