mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
8988fad713
The plugin reference is available as part of the global `cordova` object and not the global `plugins` object. This caused the plugin to `Plugin not installed warning` even though the plugin is installed and works when using through `cordova.plugins.market.open(appId);`
31 lines
724 B
TypeScript
31 lines
724 B
TypeScript
import { Plugin, Cordova } from './plugin';
|
|
/**
|
|
* @name Market
|
|
* @description
|
|
* Opens an app's page in the market place (Google Play, App Store)
|
|
*
|
|
* @usage
|
|
* ```
|
|
* import {Market} from 'ionic-native';
|
|
*
|
|
* Market.open('your.package.name');
|
|
*
|
|
* ```
|
|
*/
|
|
@Plugin({
|
|
pluginName: 'Market',
|
|
plugin: 'cordova-plugin-market',
|
|
pluginRef: 'cordova.plugins.market',
|
|
repo: 'https://github.com/xmartlabs/cordova-plugin-market'
|
|
})
|
|
export class Market {
|
|
/**
|
|
* Opens an app in Google Play / App Store
|
|
* @param appId {string} Package name
|
|
* @param callbacks {Object} Optional callbacks
|
|
*/
|
|
@Cordova({sync: true})
|
|
static open(appId: string, callbacks?: {success?: Function, failure?: Function}): void { }
|
|
|
|
}
|