Skip to content

Commit

Permalink
feat(launch-review): add LaunchReview plugin (#949)
Browse files Browse the repository at this point in the history
* Add LaunchReview

* Fix pluginRef
  • Loading branch information
biesbjerg authored and ihadeed committed Jan 20, 2017
1 parent 1e38a6c commit 9c75a06
Show file tree
Hide file tree
Showing 2 changed files with 39 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 @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -305,6 +307,7 @@ window['IonicNative'] = {
IsDebug,
Keyboard,
LaunchNavigator,
LaunchReview,
LocalNotifications,
LocationAccuracy,
Market,
Expand Down
36 changes: 36 additions & 0 deletions src/plugins/launch-review.ts
Original file line number Diff line number Diff line change
@@ -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; }

}

0 comments on commit 9c75a06

Please sign in to comment.