Please provide the following:
- SDK Version:46.0.0
- Platforms(Android/iOS/web/all): all
- Add the appropriate “Tag” based on what Expo library you have a question on.
I am trying to implement dynamic linking in my Expo app using @react-native-firebase/dynamic-links. However, I am encountering an error and need assistance resolving it.
Code snippet:
const handleDynamicLink = (link: any) => {
console.log(link);
// Handle dynamic link inside your own application
};
useEffect(() => {
const unsubscribe = dynamicLinks().onLink(handleDynamicLink);
return () => unsubscribe(); // Remove the listener when the component is unmounted
}, []);
useEffect(() => {
dynamicLinks()
.getInitialLink()
.then((link: any) => {
console.log(link);
// Perform additional actions based on the initial link
});
}, []);
Error message:
“Error: 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 and added the ‘new ReactNativeFirebaseAppPackage()’ line inside the RN ‘getPackages()’ method list.”
I am aware that using react-native-firebase directly in an Expo app is not supported, but I would like to know how to make the dynamicLinks component work in my Expo app.