1.0.5 • Published 2 years ago

onesignal-vue-3 v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

onesignal-vue-3

This is a fork of the official onesignal-vue package that has been altered to work with vue3.

Add the following to your main.ts file:

import { createApp } from 'vue';
import OneSignalVue from 'onesignal-vue-3';

createApp(App)
  .use(OneSignalVue, {
    appId: process.env.VUE_APP_ONESIGNAL_APP_ID,
  })
  .mount('#app')

And use the following code in one of your Vue components:

<script lang="ts">
import { onMounted, defineComponent } from 'vue'
import { useOneSignal } from 'onesignal-vue-3'

export default defineComponent({
    setup() {
        const oneSignal = useOneSignal()

        onMounted(async () => {
            await oneSignal.registerForPushNotifications({
                modalPrompt: true,
            })
        })
    }
})
</script>

Please check the docs of the original package to find out more information about possible configurations and usages.

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0-beta3

2 years ago