Comments (6)
No, I've adopted a solution that does not use a library.
from cordova-plugin-market.
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.
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.
The same is happening to me, have you found a solution?
from cordova-plugin-market.
Oh, please, can you tell me how you did it?
from cordova-plugin-market.
Thanks a lot
from cordova-plugin-market.
Related Issues (20)
- Error opening app store on iOS9 HOT 1
- NPM install calling plugman.fetch, overwrites custom config parameters HOT 3
- Windows and Amazon App store for android
- main.js etc missing in ionic 3 /www/build
- allow to point to android play store's alpha & beta apps
- Error in Apple Store HOT 3
- Open AppStore not finding published app, while Play Store does HOT 2
- Open with developer id
- search(keyword) is not working in ios
- Can't install plugin, 404 on ansi-styles
- Open App Store with app name
- Invalid action error HOT 1
- pop up error 'to view this content, install and set up web browsing app' on Android device HOT 1
- Allow IOS market link setting
- Error - Cannot open app store
- [Feature] Just open app-store/google-play store
- Huwei -> plugin tries to find app in App Gallery instead of playstore HOT 1
- UI API called from background thread Group
- Publish on Cordova plugins page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-market.