While trying to create a dynamicLink, this error pops up:
You attempted to use a firebase module that's not installed on your Android project by calling firebase.app() Ensure you have:
imported the 'io.invertase.firebase.app.ReactNativeFirebaseAppPackage' module in your 'MainApplication.java' file.
Added the 'new ReactNativeFirebaseAppPackage()' line inside of the RN 'getPackages()' method list.
See http://invertase.link/android for full setup instructions.
I tried installing, importing and configuring @react-native-firebase/dynamic-links
, react-redux-firebase
, @firebase/app
, firebase/app
.
Currently react-redux-firebase
is working, I can retrieve and send data to the firebase database. Is there any way I can use the firebase
from this module to add dynamic links? Right now, I try to create a link like this:
import dynamicLinks from "@react-native-firebase/dynamic-links";
export class Baklijst extends Component {
onAddPerson = async () => {
const link = dynamicLinks().buildLink({
link: "https://tomgroot.nl",
domainUriPrefix: "https://baklijst.page.link",
});
console.log(link);
return link;
};
I initialise react-redux-firebase
like this in my App.js
:
if (!firebase.apps.length) {
firebase.initializeApp(FirebaseConfig);
} else {
firebase.app();
}
...
const rrfProps = {
firebase,
config: rrfConfig,
dispatch: store.dispatch,
};
...
export default function App() {
return (
...
<ReactReduxFirebaseProvider {...rrfProps}>
...
);
}
...
According to the documentation, to reference your react-native-firebase app with the following.
Additional modules should be imported as such
To create dynamic links, you can copy the example from the documentation:
Source: https://rnfirebase.io/dynamic-links/usage#create-a-link