Skip to content

How can I use FCM when I have this module installed? #1400

Closed Answered by posva
FamilyMan asked this question in Questions and Help
Discussion options

You must be logged in to vote

You can retrieve the firebase app with useFirebaseApp() in any <script setup> or in plugins, in nuxt. You can then pass that to any service, including FCM:

<script setup>
import { useFirebaseApp } from 'vuefire'
import { getMessaging } from 'firebase/messaging'

const firebaseApp = useFirebaseApp()
const messaging = getMessaging(firebaseApp)
</script>

I think I should add a page to docs as this applies to pretty much any Firebase service, it's not in VueFire's goals to provide wrappers for everything

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@FamilyMan
Comment options

Answer selected by FamilyMan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants