feat(launch-review): add LaunchReview plugin (#949)

* Add LaunchReview

* Fix pluginRef
This commit is contained in:
Kim Biesbjerg 2017-01-20 22:11:57 +01:00 committed by Ibby Hadeed
parent 1e38a6c005
commit 9c75a06131
2 changed files with 39 additions and 0 deletions

View File

@ -70,6 +70,7 @@ import { Instagram } from './plugins/instagram';
import { IsDebug } from './plugins/is-debug';
import { Keyboard } from './plugins/keyboard';
import { LaunchNavigator } from './plugins/launchnavigator';
import { LaunchReview } from './plugins/launch-review';
import { LocalNotifications } from './plugins/localnotifications';
import { LocationAccuracy } from './plugins/location-accuracy';
import { MediaCapture } from './plugins/media-capture';
@ -187,6 +188,7 @@ export * from './plugins/instagram';
export * from './plugins/is-debug';
export * from './plugins/keyboard';
export * from './plugins/launchnavigator';
export * from './plugins/launch-review';
export * from './plugins/localnotifications';
export * from './plugins/location-accuracy';
export * from './plugins/market';
@ -305,6 +307,7 @@ window['IonicNative'] = {
IsDebug,
Keyboard,
LaunchNavigator,
LaunchReview,
LocalNotifications,
LocationAccuracy,
Market,

View File

@ -0,0 +1,36 @@
import { Plugin, Cordova } from './plugin';
/**
* @name LaunchReview
* @description
*
* This launches the native store app in order for the user to leave a review.
* On Android, the plugin opens the the app's storepage in the Play Store where the user can leave a review by pressing the stars to give a rating.
* On iOS, the plugin opens the app's storepage in the App Store and focuses the Review tab, where the user can leave a review by pressing "Write a review".
*
* @usage
* ```
* import { LaunchReview } from 'ionic-native';
*
* const appId: string = 'yourAppId';
* LaunchReview.launch(appId)
* .then(() => console.log('Successfully launched store app');
* ```
*/
@Plugin({
pluginName: 'LaunchReview',
plugin: 'cordova-launch-review',
pluginRef: 'LaunchReview',
repo: 'https://github.com/dpa99c/cordova-launch-review',
platforms: ['Android', 'iOS']
})
export class LaunchReview {
/**
* Launch store app using given app ID
* @returns {Promise<void>}
*/
@Cordova()
static launch(appId: string): Promise<void> { return; }
}