Skip to content

Firebase Cloud Storage 'getDownloadUrl' Not Working With Ionic 'capacitor://localhost' iOS #7410

@solimanware

Description

@solimanware

Operating System

iOS 16.5

Browser Version

Capacitor iOS WebView

Firebase SDK Version

9

Firebase SDK Product:

Storage

Describe your project's tooling

Ionic Angular Capacitor

Describe the problem

No output for getDownloadUrl when served from capacitor://localhost (native app) when running command 'ionic cap build ios' and running the project from Xcode but works from http://localhost when running command 'ionic cap run ios -l --external --open '

I tried using then/catch and tried try/catch with no hope, and checked the source code of the library and seems the lib doesn't through an error if there. I tried to edit the lib from node_modules but with the build process of tree shaking, minification, uglification, and removing console.logs() that was super hard. I know that Google mustn't support strange protocols like capacitor://localhost but that how 30% of the market apps uses right now, can I get little help please what is going wrong? maybe some whitelisting maybe some storage permissions? I spent 10 hours straight debugging this, but with no good news...

Steps and code to reproduce issue

in 'http://localhost'

getDownloadURL(storageRef)
          .then((res) => {
            console.log(res); //working
          })
          .catch((err) => {
            console.log(err); //no output
          });

in 'capacitor://localhost'

getDownloadURL(storageRef)
          .then((res) => {
            console.log(res); //no output
          })
          .catch((err) => {
            console.log(err); //no output
          });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions