I have a react native app with react-native-firebase and I'm trying to run a callable https firebase function which is deployed to a custom region.
I've read that firebase.app().functions("MY-REGION") so I tried the following:
import { firebase } from "@react-native-firebase/database"
import functions from "@react-native-firebase/functions"
firebase.app().functions("MY-REGION")
But If I run that I get this error:
Error: You attempted to use
"firebase.app('[DEFAULT]').functions" but this
module could not be found.
Ensure you have installed and imported the
'@react-native-firebase/functions' package
The functions package is installed.
If I remove the @react-native-firebase/functions import the error stays the same.
How can I specify the region for firebase https functions in react-native-firebase?
More attempts:
firebase.initializeApp({
...options
})
firebase.app().functions("MY-REGION")
And that says Error: Firebase App named '[DEFAULT]' already exists
firebase.initializeApp({
...options
}, "APP_NAME")
firebase.app("APP_NAME").functions("MY-REGION")
Gives Error: No firebase App 'APP_NAME' has been created - call firebase.initializeApp()
I hope I'm missing something trivial.