-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(launch-review): add LaunchReview plugin (#949)
* Add LaunchReview * Fix pluginRef
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
|
||
} |