How to use `cordova-plugin-universal-links` to create universal link for cordova app

  • I’m developing a cordova app using quasar framework and I’m trying to add universal link to the app using cordova-plugin-universal-links. Here is the documentation: This plugin export an module universalLinks to help subscribe universal link event.
    However, I’m not sure how to subscribe event using universalLinks module. I was trying to add codes like this:

        ...some html code...
    // import { universalLinks } from 'cordova-plugin-universal-links'
    export default {
      name: 'default',
      components: {
      data () {
        return {
      mounted () {
        var app = {
          // Application Constructor
          initialize: function () {
          // Bind Event Listeners
          bindEvents: function () {
            document.addEventListener('deviceready', this.onDeviceReady, false)
          // deviceready Event Handler
          onDeviceReady: function () {
            console.log('Device is ready for work')
            // window.universalLinks.subscribe('openApp', function (eventData) {
              universalLinks.subscribe('openApp', function (eventData) {
              // do some work to show list of news
        // await this.$store.dispatch('common/loadPredefinedScreens')

    Here is the quasar documentations for using cordova plugins. However, when I try to run and build the app, it post an error saying universalLinks not defined, and then I tried to use window.universalLinks but it does not work either. According to quasar documentation, cordova module should be injected into window, but it does not work.
    Anyone can help to tell me how quasar framework uses cordova-plugin-universal-links

Log in to reply