Erel said:
The behavior should be the same. Add log messages to better understand the flow.
I added log messages in B4i as follows:
'...
DownloadFromFirebase(filepath)
Wait For storage_DownloadCompleted (ServerPath As String, Success As Boolean)
Log("Wait For is over. Continuing with next statement ...")
'...
Sub DownloadFromFirebase(filepath)
'...
storage.DownloadFile(filepath,destdir,destname)
Log("Download started ...")
'...
End Sub
Sub storage_DownloadCompleted (ServerPath As String, Success As Boolean)
Log("Download completed.")
End Sub
The expected log messages would be:
Download started ...
Download completed.
Wait For is over. Continuing with next statement ...
Instead, I get:
Download started ...
Wait For is over. Continuing with next statement ...
... and Download completed never happens!
Now, if I comment out the Wait For statement, I get:
Download started ...
Download completed.
So it seems that the fact that I have a
Wait For somehow disables the storage_DownloadCompleted event from firing. Makes no sense to me, and as I said, there's no such behavior in B4A with identical code. I can get around this by not using Wait For and putting code in storage_DownloadCompleted but that seems like a cowardly thing to do
.
Any possibility that Wait For in B4i somehow breaks the code in the iFirebaseStorage Library?