I'm new to JavaScript and web apps and I'm building a Vue app that uses Firebase for hosting, database, authentication, and messaging. My app stores certain items, and I want to send a push notification to users subscribed to each item when it gets updated.
I'm trying to follow this Firebase Cloud Messaging (FCM) documentation to achieve this: https://firebase.google.com/docs/cloud-messaging/send-message?hl=es-419#send_messages_to_device_groups
However, I'm having trouble invoking the send() method because the getMessaging() function I'm importing from 'firebase/messaging' (and the Messaging type it returns) doesn't have any methods. It only has the app property.
I'm concerned that this approach might not be intended for client apps, and that it might be impossible to achieve what I want with a simple Vue app.
Any insights or suggestions would be greatly appreciated.
I've attempted to resolve the issue by using the "// @ts-ignore" tag and invoking the "send()" method anyway. Additionally, I've tried installing @firebase/messaging-types with npm, searching for videos and examples, and re-reading the documentation repeatedly.
I had expected that vscode would stop underlining "send" in red and that my push notifications would work.