No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

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

    Help
    1
    1
    469
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Misaosama last edited by

      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: https://github.com/eldadfux/cordova-plugin-universal-links. 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:

      <template>
          ...some html code...
      </template>
      
      <script>
      // import { universalLinks } from 'cordova-plugin-universal-links'
      export default {
        name: 'default',
        components: {
        },
        data () {
          return {
          }
        },
        mounted () {
          var app = {
            // Application Constructor
            initialize: function () {
              this.bindEvents()
            },
      
            // 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) {
                console.log('openApp.')
                // do some work to show list of news
              })
            }
          }
          app.initialize()
          // await this.$store.dispatch('common/loadPredefinedScreens')
        }
        }
      }
      </script>
      

      https://quasar.dev/quasar-cli/developing-cordova-apps/cordova-plugins
      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

      1 Reply Last reply Reply Quote 0
      • First post
        Last post