angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

AngularFireStorage not working with capacitorHttp on native device

Open dodomui opened this issue 2 years ago • 5 comments

Version info

Angular: 16.1.1

Firebase: 9.23.0

AngularFire: 7.6.1

Other (e.g. Ionic/Cordova, Node, browser, operating system): Ionic:

Ionic CLI : 7.1.1 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 7.1.2 @angular-devkit/build-angular : 16.1.4 @angular-devkit/schematics : 16.1.4 @angular/cli : 16.1.4 @ionic/angular-toolkit : 10.0.0

Capacitor:

Capacitor CLI : 5.1.1 @capacitor/android : 5.1.1 @capacitor/core : 5.1.1 @capacitor/ios : 5.1.1

How to reproduce these conditions

Failing test unit, Stackblitz demonstrating the problem

Steps to set up and reproduce

When enable capacitorHttp Angularfire storage unable to upload image on native device. Received error below.

Sample data and security rules

Debug output

** Errors in the JavaScript console ** FirebaseError: Firebase Storage: An unknown error occurred, please check the error payload for server response. (storage/unknown)

** Output from firebase.database().enableLogging(true); **

** Screenshots **

Expected behavior

Actual behavior

dodomui avatar Jul 10 '23 07:07 dodomui

Is there anyway you can create an MVCE for me to check why? I'm not super familiar with Capacitor but if I have a base project and debugging setup I can check to see what's going on.

davideast avatar Jul 10 '23 17:07 davideast

Is there anyway you can create an MVCE for me to check why? I'm not super familiar with Capacitor but if I have a base project and debugging setup I can check to see what's going on.

@davideast Do you have any recommendation for creating MVCE? I can try to reproduce the environment.

dodomui avatar Jul 11 '23 02:07 dodomui

@dodomui If there's an online IDE for using Capacitor that would be best. Otherwise a GitHub repo with setup and reproducible steps will help.

davideast avatar Jul 11 '23 10:07 davideast

Got it. Will prepare this later.

dodomui avatar Jul 25 '23 06:07 dodomui

@dodomui I'm not able to run any transactions. My app crashes with the following message on iOS Error: Uncaught (in promise): Error: Service firestore is not available getImmediate@capacitor.

I'm just using Firestore with the default angularFire setup from ng add. I'm struggling to find a solution, it works without issue on my browser, but not native.

Are you doing any additional initialization other than

    provideFirebaseApp(() => initializeApp(environment.firebase)),
    provideFirestore(() => getFirestore())

jongbonga avatar Oct 15 '23 20:10 jongbonga