Skip to content

Commit

Permalink
feat(market): add Market plugin support (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Aug 27, 2016
1 parent cd82a53 commit 9bcc4ed
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import { MediaCapture } from './plugins/media-capture';
import { NativeAudio } from './plugins/native-audio';
import { NativePageTransitions } from './plugins/native-page-transitions';
import { NativeStorage } from './plugins/nativestorage';
import { Market } from './plugins/market';
import { MediaPlugin } from './plugins/media';
import { Network } from './plugins/network';
import { OneSignal } from './plugins/onesignal';
Expand Down Expand Up @@ -175,6 +176,7 @@ Keyboard,
NativeAudio,
NativeStorage,
Network,
Market,
OneSignal,
PhotoViewer,
ScreenOrientation,
Expand Down Expand Up @@ -256,6 +258,7 @@ window['IonicNative'] = {
Keyboard: Keyboard,
LaunchNavigator: LaunchNavigator,
LocalNotifications: LocalNotifications,
Market: Market,
MediaCapture: MediaCapture,
MediaPlugin: MediaPlugin,
NativeAudio: NativeAudio,
Expand Down
29 changes: 29 additions & 0 deletions src/plugins/market.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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({
plugin: '',
pluginRef: '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 { }

}

0 comments on commit 9bcc4ed

Please sign in to comment.