mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
feat(InAppReview): add InAppReview plugin (#2483)
This commit is contained in:
parent
47f739777e
commit
bfe5ae9cf2
47
src/ionic-native/plugins/in-app-review
Normal file
47
src/ionic-native/plugins/in-app-review
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name In App Review
|
||||||
|
* @description
|
||||||
|
* This plugin does use the iOS class SKStoreReviewController to open the inApp review popup available since iOS 10.3
|
||||||
|
*
|
||||||
|
* This functionality only works on iOS devices
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { InAppReview } from '@ionic-native/in-app-review';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private inAppReview: InAppReview) { }
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* this.inAppReview.requestReview()
|
||||||
|
* .then((res: any) => console.log(res))
|
||||||
|
* .catch((error: any) => console.error(error));
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'InAppReview',
|
||||||
|
plugin: 'com.omarben.inappreview',
|
||||||
|
pluginRef: 'inappreview',
|
||||||
|
repo: 'https://github.com/omaxlive/com.omarben.inappreview',
|
||||||
|
platforms: ['iOS']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class InAppReview extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the inApp review popup
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
requestReview(): Promise<any> {
|
||||||
|
return; // We add return; here to avoid any IDE / Compiler errors
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user