Integrating Cordova Purchase Plugin with Framework7


#1

I am working to initialize a plugin with Framework 7. The cordova plugin needs to wait for the device ready event and suggests attaching an event handler like so:

document.addEventListener('deviceready', callback, false)

Is the following structure a congruent way to detect the deviceready event?

  id: 'com.phonegap.test12345',
  on: {
    init: function() {
      // cordova.plugin.initialize()
    }
  },
  initOnDeviceReady: true,
  root: '#app',
  theme: theme,
  photoBrowser: {
    type: 'standalone',
    theme: 'light',
    navbar: true,
    swiper: {
			initialSlide: 0,
      spaceBetween: 20,
      speed: 300,
      loop: false,
      preloadImages: true,
      navigation: {
        nextEl: '.photo-browser-next',
        prevEl: '.photo-browser-prev',
      },
      zoom: {
        enabled: true,
        maxRatio: 3,
        minRatio: 1,
        },
      lazy: {
        enabled: true,
      },
    },	
  },
  data: function () {
    return {
      user: {
        firstName: 'John',
        lastName: 'Doe',
      },
    };
  },
  methods: {
    helloWorld: function () {
      app.dialog.alert('Hello World!');
    }
  },
  routes: routes,
  vi: {
    placementId: 'pltd4o7ibb9rc653x14',
  },
});```