question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: firebase v9 not working on iOS

See original GitHub issue

Bug Report

Capacitor Version

PASTE OUTPUT HERE

Platform(s)

iOS

Current Behavior

firebase v9 refuses to connect on iOS due to the following errors below. On safari, android, chrome, everything else, works fine.

[Error] Cross-origin redirection to http://developers.google.com/ denied by Cross-Origin Resource Sharing policy: Origin capacitor://localhost is not allowed by Access-Control-Allow-Origin. [Error] XMLHttpRequest cannot load https://apis.google.com/_/jserror?script=https%3A%2F%2Fapis.google.com%2F_%2Fscs%2Fabc-static%2F_%2Fjs%2Fk%3Dgapi.lb.pt_BR.JNlq9XF7n9c.O%2Fm%3Dgapi_iframes%2Frt%3Dj%2Fsv%3D1%2Fd%3D1%2Fed%3D1%2Frs%3DAHpOoo_CgjdRKayLAI-SffAgrENAd8_UBA%2Fcb%3Dgapi.loaded_0%3Fle%3Dscs&error=x`capacitor&line=183 due to access control checks. [Error] Failed to load resource: Cross-origin redirection to http://developers.google.com/ denied by Cross-Origin Resource Sharing policy: Origin capacitor://localhost is not allowed by Access-Control-Allow-Origin. (jserror, line 0)

Expected Behavior

Shoulda connect normally. Appears that the domain from http://developers.google.com/ appears to be refusing the connection, tho version 8 of firebase worked normally.

Code Reproduction

Just imported all the libraries from firebase

Other Technical Details

npm --version output: 8.5.5

node --version output: 12.22.8

pod --version output (iOS issues only): 1.10.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
nilebmacommented, Aug 17, 2022

Hi ! I got the same problem, it was was caused by a bad initialisation of FireAuth in my case.

See how to properly initialise FireAuth here : https://stackoverflow.com/questions/71630326/firebase-authentication-sticks-capacitor-ionic-on-ios

1reaction
JSilva6commented, Apr 27, 2022

Did you figure out anything on this error, @JSilva6? I’m having the same issue.

For now I went back to v8.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting & FAQ for Apple platforms and Firebase
This page offers tips and troubleshooting for Apple platform-specific issues that you might encounter when using Firebase.
Read more >
Firebase auth in SDK 9 does not work on ios sim or devices
I recently moved to the firebase v9 sdk for a brand new ionic/angular project. I was able to get the signInWithEmailAndPassword call to...
Read more >
firebase-js-sdk v9 doesn't work with react native? Error
I downgraded firebase version to v9.6.1 which works fine.
Read more >
Authentication | React Native Firebase
catch(error => { if (error.code === 'auth/operation-not-allowed') { console.
Read more >
Using Firebase - Expo Documentation
Want to create a universal app for Android, iOS, and the web. Caveats. Firebase JS SDK does not support all services for mobile...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found