B4J Question [BANano] Debug & Release mode B4xlib challenges with CallAjaxWait? in lib?

Mashiane

Expert
Licensed User
Longtime User
Ola

I have created a b4xlib with this code. Everything works when I run an app built with the library in Release mode. As soon as I try and debug my app dependent on the library built with this code, nothing works.


B4X:
Sub GetFileListFromTarget(e As BANanoEvent) As List
    Dim files As List = e.OtherField("target").GetField("files").Result
    Return files
End Sub

''on file change
Sub UploadFileWait(e As BANanoEvent) As BANanoPromise
    Dim prom As BANanoPromise
    'get selected file(s)
    Dim fileList As List = GetFileListFromTarget(e)
    If fileList.size = 0 Then Return prom
    
    'get the file to upload
    Dim fileO As Map = fileList.Get(0)
    'start uploading the file
    Dim fd As BANanoObject
    fd.Initialize2("FormData", Null)
    fd.RunMethod("append", Array("upload", fileO))
    '
    prom = BANano.CallAjaxWait("./assets/upload.php", "POST", "", fd, True, Null)
    Return prom
End Sub
 
Top