In my ReactNative (expo) project, if I import the package like this:
import { firebase } from "@react-native-firebase/messaging";
then I can use firebase.message()
without any problems (it works only for native projects, not on the expo-dev server).
But if I am trying to use dynamic import for ex. like this:
import("@react-native-firebase/messaging").then(firebase => { firebase.messaging() // undefined})
in that case the "messaging" property is undefined. What is the reason for that and how can I use it properly?
I want to import the package dynamically or programmatically because I'm using Expo and NativeModules are required for this package.