Currently, I am utilizing the @react-native-firebase/messaging
library and invoking the method
messaging().onNotificationOpenedApp(remoteMessage => ....)
I am aiming to replace the property data
within the type of remoteMessage
in order to benefit from TypeScript intellisense when sending notifications.
The updated data
type that I am looking to achieve is:
data: {
page: PageType
pageProps: {
id: string
....
}
}
I have attempted to define a global.d.ts
file in the root directory of my project with the following:
declare global {
namespace FirebaseMessagingTypes {
interface RemoteMessage extends MyCustomDataType { }
}
}
Unfortunately, this approach did not yield the desired outcome. Is there a way to globally override this type without explicitly setting the function's property type?
Thank you =D