iOS Question Firebase storage not downloading

karld

Active Member
Licensed User
Longtime User
I have been away from my computer for a few months and I am returning to an app I am writing.

Does anyone have an example of using Firebase storage with IOS?

I see lots of examples with auth with google and facebook, etc. I just want to pull files from storage.

I have downloaded the framework to my local builder.
I have enabled both analytics and storage.
I initialized storage and analytics
My code is running and does not generate any errors in my log. The storage_downloadcompleted never fires.
examples of my code
Here is where the analytics and storage are initialized
B4X:
    Private analytics As FirebaseAnalytics
    Private starter As FirebaseStorage

the GS is XXX out on purpose. I have my real GS in my code
B4X:
    analytics.Initialize
    starter.Initialize("starter","gs://XXXXXXXXXXXXX/")

Here is where I pull the file down for FirebaseStorage
I get bothe the "Starting Download" and "Download Done" in my log
B4X:
Sub UpdateServiceCodes
    Log("starting download")
starter.DownloadFile("/public/Update.xml", DBFileDir, UDFileName)
Log("download done")
End Sub

This code never runs
B4X:
Sub Storage_DownloadCompleted (ServerPath As String, Success As Boolean)
    'hd.ToastMessageShow($"DownloadCompleted. Success = ${Success}"$, True)
    Msgbox("Download Completed ","Database Update")
    DoUpdate
   
    If Not(Success) Then Log(LastException)
End Sub

I am porting over from my Android app, which works perfectly.

The tutorial for B4A is very detailed on using Firebase Storage.
I am unable to find an example, or tutorial for Firebase Storage with B4i.

I am getting frustrated trying to figure this out.
ANY help is greatly appreciated.
 

karld

Active Member
Licensed User
Longtime User
I changed code to this and it still never shows toast message.
it never shows anything I can see in the log.
It is as if it never even tries to download from Firebase.
At this point I have no idea what I am missing. :mad::mad::mad::mad:
B4X:
Sub starter_DownloadCompleted (ServerPath As String, Success As Boolean)
    hd.ToastMessageShow($"DownloadCompleted. Success = ${Success}"$, True)

    'DoUpdate
   
    If Not(Success) Then Log(LastException)
End Sub
 
Upvote 0

karld

Active Member
Licensed User
Longtime User
Alrighty! Got it downloading now.
I am a dumbass...

I was missing a letter in my package name.
DUH!!!

Thanks for the input.
 
Upvote 0
Top