Skip to content

Commit

Permalink
Just open App Store page for app on iOS 11+, since it's no longer pos…
Browse files Browse the repository at this point in the history
…sible to directly open the review section. See #6.
  • Loading branch information
dpa99c committed Sep 18, 2017
1 parent 87a0668 commit d48792e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ This Cordova/Phonegap plugin for iOS and Android launches the native store app i

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, focuses the Review tab, and automatically opens the dialog for the user to leave a rating or review.
On iOS 10.3 and above, there is also support for the in-app ratings dialog which allows a user to rate your app without needing to open the App Store.
On iOS 10.3 and below, the plugin opens the app's storepage in the App Store, focuses the Review tab, and automatically opens the dialog for the user to leave a rating or review.
On iOS 11.0 and above, the plugin only opens the app's storepage in the App Store since it's no longer possible to directly open the Review section.
On iOS 10.3 and above, the plugin supports the []native in-app rating dialog](https://developer.apple.com/documentation/storekit/skstorereviewcontroller/2851536-requestreview) which allows a user to rate your app without needing to open the App Store.

The plugin is registered on [npm](https://www.npmjs.com/package/cordova-launch-review) (requires Cordova CLI 5.0.0+) as `cordova-launch-review`

Expand Down
6 changes: 6 additions & 0 deletions src/ios/LaunchReview.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ - (void) launch:(CDVInvokedUrlCommand*)command;
@try {
CDVPluginResult* pluginResult;
NSString* appId = [command.arguments objectAtIndex:0];
#if defined(__IPHONE_11_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0
NSString* iTunesLink = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@", appId];
#else
NSString* iTunesLink = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@&action=write-review", appId];
#endif

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];

pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
Expand Down Expand Up @@ -70,3 +75,4 @@ - (void) handlePluginException: (NSException*) exception :(CDVInvokedUrlCommand*
}

@end

0 comments on commit d48792e

Please sign in to comment.