Skip to content

Commit

Permalink
feat(market): add search method, return promises
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Jan 7, 2017
1 parent 009a206 commit d62779a
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/plugins/market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,30 @@ import { Plugin, Cordova } from './plugin';
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 in the format {success?: Function, failure?: Function}
* @return {Promise<any>}
*/
@Cordova({
callbackStyle: 'object',
successName: 'success',
errorName: 'failure'
})
static open(appId: string): Promise<any> { return }

/**
* Search apps by keyword
* @param keyword {string} Keyword
* @return {Promise<any>}
*/
@Cordova({sync: true})
static open(appId: string, callbacks?: {success?: Function, failure?: Function}): void { }
@Cordova({
callbackStyle: 'object',
successName: 'success',
errorName: 'failure',
platforms: ['Android']
})
static search(keyword: string): Promise<any> { return }

}

0 comments on commit d62779a

Please sign in to comment.