feat(launch-review): add LaunchReview plugin (#949)
* Add LaunchReview * Fix pluginRef
This commit is contained in:
parent
1e38a6c005
commit
9c75a06131
@ -70,6 +70,7 @@ import { Instagram } from './plugins/instagram';
|
|||||||
import { IsDebug } from './plugins/is-debug';
|
import { IsDebug } from './plugins/is-debug';
|
||||||
import { Keyboard } from './plugins/keyboard';
|
import { Keyboard } from './plugins/keyboard';
|
||||||
import { LaunchNavigator } from './plugins/launchnavigator';
|
import { LaunchNavigator } from './plugins/launchnavigator';
|
||||||
|
import { LaunchReview } from './plugins/launch-review';
|
||||||
import { LocalNotifications } from './plugins/localnotifications';
|
import { LocalNotifications } from './plugins/localnotifications';
|
||||||
import { LocationAccuracy } from './plugins/location-accuracy';
|
import { LocationAccuracy } from './plugins/location-accuracy';
|
||||||
import { MediaCapture } from './plugins/media-capture';
|
import { MediaCapture } from './plugins/media-capture';
|
||||||
@ -187,6 +188,7 @@ export * from './plugins/instagram';
|
|||||||
export * from './plugins/is-debug';
|
export * from './plugins/is-debug';
|
||||||
export * from './plugins/keyboard';
|
export * from './plugins/keyboard';
|
||||||
export * from './plugins/launchnavigator';
|
export * from './plugins/launchnavigator';
|
||||||
|
export * from './plugins/launch-review';
|
||||||
export * from './plugins/localnotifications';
|
export * from './plugins/localnotifications';
|
||||||
export * from './plugins/location-accuracy';
|
export * from './plugins/location-accuracy';
|
||||||
export * from './plugins/market';
|
export * from './plugins/market';
|
||||||
@ -305,6 +307,7 @@ window['IonicNative'] = {
|
|||||||
IsDebug,
|
IsDebug,
|
||||||
Keyboard,
|
Keyboard,
|
||||||
LaunchNavigator,
|
LaunchNavigator,
|
||||||
|
LaunchReview,
|
||||||
LocalNotifications,
|
LocalNotifications,
|
||||||
LocationAccuracy,
|
LocationAccuracy,
|
||||||
Market,
|
Market,
|
||||||
|
36
src/plugins/launch-review.ts
Normal file
36
src/plugins/launch-review.ts
Normal 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; }
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user