Coder Social home page Coder Social logo

Erro execute open about cordova-plugin-market HOT 6 OPEN

xmartlabs avatar xmartlabs commented on August 17, 2024
Erro execute open

from cordova-plugin-market.

Comments (6)

igorlacerdacarneiro avatar igorlacerdacarneiro commented on August 17, 2024 3

No, I've adopted a solution that does not use a library.

from cordova-plugin-market.

hemantv avatar hemantv commented on August 17, 2024 3

There seems to be some issue with Ionic Native wrapper of plugin. You can still use the plugin using window["cordova"].plugins["market"].open(APP_ID);

Works just fine.

from cordova-plugin-market.

igorlacerdacarneiro avatar igorlacerdacarneiro commented on August 17, 2024 2

My solution was, I created an endpoint where I stored the latest version released and that is available in the application store. So, when I enter the application I call this endpoint and with the native Device, Platform and AppVersion libraries, I can make the comparisons and check if it has a newer version for the user.

Here's my code to better understand:
`let appUrl: string
    let localAppVersion: any
    const devicePlatform: string = this.device.platform
    localAppVersion = await this.appVersion.getVersionNumber ()
 
    if (devicePlatform == 'Android') {
      appUrl = 'https://play.google.com/store/apps/details?id=YOUR_PACKAGE'
    } else if (devicePlatform == 'iOS') {
      appUrl = 'https://itunes.apple.com/us/app/YOUR_APP/APP_ID'
    } else {
      console.log ('Device not recognized.')
    }

    this.disableButton = true;
    let loader = this.loadingCtrl.create ({content: 'Validating application version ...'})
    loader.present ()
    this.userProvider.getAppVersion ().
      appVersion => {
        loader.dismiss ()
        if (localAppVersion <appVersion) {
          this.alertCtrl.create ({
            title: 'New version available!',
            message: 'An application update is available. To continue using it, please update it. ',
            buttons: [
              {
                text: 'Cancel', scroll: 'cancel'
              },
              {
                text: 'Update', handler: () => {window.open (appUrl)}
              }
            ]
          }).
        } else {
          console.log ('Application updated')
          this.disableButton = false;
        }
      }
    )
  }`

from cordova-plugin-market.

Blast06 avatar Blast06 commented on August 17, 2024

The same is happening to me, have you found a solution?

from cordova-plugin-market.

Blast06 avatar Blast06 commented on August 17, 2024

Oh, please, can you tell me how you did it?

from cordova-plugin-market.

Blast06 avatar Blast06 commented on August 17, 2024

Thanks a lot

from cordova-plugin-market.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.