220

I want to put a "rate/review this app" feature into my app.

Is there a way to link directly to the screen in the app store where they review the app? So the customer doesn't have to click through the main app link. Thanks.

EDIT: starting a bounty on this due to the lack of response. Just to make sure it is crystal clear: I am aware that I can link to my app's page in the store, and ask the user to click from there to the "review this app" screen. The question is whether it is possible to link directly to the "review this app" screen so they don't have to click through anything.

William Jockusch
  • 26,513
  • 49
  • 182
  • 323

29 Answers29

361

For versions lower than iOS 7 use the old one:

itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=YOUR_APP_ID

This works on my end (Xcode 5 - iOS 7 - Device!):

itms-apps://itunes.apple.com/app/idYOUR_APP_ID

For iOS 8 or later:

itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=YOUR_APP_ID&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software

Code snippet (you can just copy & paste it):

#define YOUR_APP_STORE_ID 545174222 //Change this one to your ID

static NSString *const iOS7AppStoreURLFormat = @"itms-apps://itunes.apple.com/app/id%d";
static NSString *const iOSAppStoreURLFormat = @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d";

[NSURL URLWithString:[NSString stringWithFormat:([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f)? iOS7AppStoreURLFormat: iOSAppStoreURLFormat, YOUR_APP_STORE_ID]]; // Would contain the right link
Mohammad Zaid Pathan
  • 16,304
  • 7
  • 99
  • 130
elibud
  • 8,119
  • 2
  • 21
  • 21
  • 175
    Note - the "type=Purple+Software" *has* to be there and it *has* to be literally "Purple Software" - it's not the name of your company, it's a codename for iPhone applications :) I wasted an hour before I figured this out... – Kuba Suder Oct 24 '11 at 11:27
  • 16
    It's worth noting that this doesn't work in the simulator, but it works on an actual device. – Joseph Nov 08 '12 at 21:35
  • 1
    FYI, this seems to work in iPad, but ONLY the second time, never the first time I try it. (After killing iTunes & App Store apps) – Michael Dec 02 '12 at 01:37
  • This is showing blank page for iOS7, there is a solution which is not perfect but its better than current behavior on iOS7 (which is blank screen) take a reference of post http://stackoverflow.com/questions/18905686/itunes-review-url-and-ios-7-ask-user-to-rate-our-app-appstore-show-a-blank-pag – mask Sep 26 '13 at 19:20
  • 13
    On iOS 7 this is taking me to the store page, but does not select the review tab. – devios1 Oct 07 '13 at 08:40
  • The NSString format specifiers in the links should be %i, not %@, for the code to work. – Si. Jan 28 '14 at 12:35
  • 1
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f)? iOS7AppStoreURLFormat: iOSAppStoreURLFormat, YOUR_APP_STORE_ID]]]; // Would contain the right link – JRam13 Jan 26 '15 at 20:59
  • The iOS 7 version everyone keeps posting doesn't take me to the review page. Using the WebObjects version works correctly on both iOS 8 and 9. – user3344977 Mar 28 '16 at 19:09
  • @James, there's a typo in your current iOS 8 and later version. In the start of the url it says **tms-apps**. It should be **itms-apps**. – Ahmad Jul 30 '16 at 18:54
  • This works on IOS 9 "itms-apps://itunes.apple.com/app/idAPPID anyone have any explanations ? Can I go by this or I have to use that long url mentioned in the answer – Alok C Sep 03 '16 at 07:25
  • Tested working on iOS 10: the horrific "Purple Software" link above. Why purple software? – xaphod Sep 23 '16 at 19:27
  • Do iTunes Affiliate links work with this? So if I add `&at=XYZ&ct=ABC` at the end will it drop a cookie? – Ethan Allen Sep 30 '16 at 21:42
  • By the way, be careful when testing your app on the simulator : these links to iTunes DO NOT work on the simulator! – Frederic Adda Oct 31 '16 at 09:53
  • for reviews tab see the answer of Latinos below – Werner Kratochwil Dec 16 '16 at 09:40
  • Could you please also provide a solution for `macOS`? – ixany Dec 20 '16 at 08:47
  • 45
    As part of iOS 10.3 there's a [new query parameter](https://developer.apple.com/reference/storekit/skstorereviewcontroller/2851536-requestreview#discussion) that can be added to the URL: `action=write-review`. I have tested this on iOS 10.2 and it works, but I do not know how far back this goes. **This will open the "Write a Review" dialogue**, rather than just showing the review tab. Example: https://itunes.apple.com/gb/app/id929726748?action=write-review&mt=8 – Joseph Duffy Jan 25 '17 at 17:13
  • @JosephDuffy That's quite nice, have you (or anyone) tested this `action=write-review` param to see if adding it breaks the AppStore when opening on a iOS 8/9 device? – Fdo Feb 28 '17 at 14:53
  • 1
    I have tested it on iOS 9.3.5 and it works. On iOS 7.1.2 is does not. All I know is that the support starts somewhere between 8.0 and 9.3.5! @Fdo – Joseph Duffy Mar 01 '17 at 16:05
  • is purple software official? – Gajendra K Chauhan Sep 03 '17 at 14:21
  • `action=write-review` doesn't appear to be working for me in iOS 11 GM. – Kane Cheshire Sep 18 '17 at 21:22
  • See my answer below for the solution on iOS 11+. – kspearrin Sep 29 '17 at 03:35
  • 1
    For anyone who uses this `itms-apps:` and does not work on the iOS Simulator, that is because simulator does not have app store app to handle it. Trying on a real device will work. Hope this will save you some time. – Zac Kwan Dec 04 '17 at 12:31
86

Update:

Swift 5.1, Xcode 11

Tested on Real Device iOS 13.0 (Guarantee to work)

import StoreKit

func rateApp() {

    if #available(iOS 10.3, *) {

        SKStoreReviewController.requestReview()
    
    } else {

        let appID = "Your App ID on App Store"
        let urlStr = "https://itunes.apple.com/app/id\(appID)" // (Option 1) Open App Page    
        let urlStr = "https://itunes.apple.com/app/id\(appID)?action=write-review" // (Option 2) Open App Review Page
        
        guard let url = URL(string: urlStr), UIApplication.shared.canOpenURL(url) else { return }
        
        if #available(iOS 10.0, *) {
            UIApplication.shared.open(url, options: [:], completionHandler: nil)
        } else {
            UIApplication.shared.openURL(url) // openURL(_:) is deprecated from iOS 10.
        }
    }
}
Strong84
  • 1,869
  • 2
  • 19
  • 24
45

EDIT: iOS 11 Solution

This is the solution to my original answer (see below). When using the iOS 11 the following link format will work:

https://itunes.apple.com/us/app/appName/idAPP_ID?mt=8&action=write-review

Simply replace APP_ID with your specific app ID. The key to make the link work is the country code. The link above uses the us code but it actually doesn't matter which code is used. The user will automatically be redirected to his store.

iOS 11 Update:

It seems that none of the solutions presented in the other answers to get directly to the Review Page works on iOS 11.

The problem most likely is, that an app page in the iOS 11 App Store app does NOT have a Review Tab anymore. Instead the reviews are now located directly below the description and the screenshots. Of course it could still be possible to reach this section directly (e.g. with some kind of anchor), but it seems that this is not supported / intended by Apple.

Using one of the following links does not work anymore. They still bring the users to the App Store app but only to a blank page:

itms-apps://itunes.apple.com/app/idYOUR_APP_ID?action=write-review
itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=YOUR_APP_ID&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software

Everyone how still uses these links should update their apps ASAP, because referring the users to a blank App Store page is most likely not what you intended.

Links which do not refer to the Review page but to the App page, still work however, e.g.

itms-apps://itunes.apple.com/app/idYOUR_APP_ID   (same as above, but without write-review parameter)

So, you can still get the users to your apps Store page, but not directly to the review section anymore. Users now have to scroll down to the review section manually to leave their feedback.

Without a question this a "great and awesome benefit for User Experience and will help developers to engage users to leave high quality reviews without annoying them". Well done Apple...

Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
  • SKStoreReviewController. requestReview() is working or not ? – dev_m Sep 09 '17 at 10:59
  • 1
    About SKStoreReviewController: "Request StoreKit to ask the user for an app review. This may or may not show any UI". So SKStoreReviewController is not the solution. I try to avoid it. – Fallstreak Dec 30 '17 at 12:07
38

Everything, written above is correct. Just a sample to insert into the app and change {YOUR APP ID} to actual app id, taken from iTunesconnect to show the Review page. Please note, as it was commented above, that it is not working on the Simulator - just the device.

  • Correcting because of iOS 7 changes.
  • Correcting for iOS 10+ openURL changes
  • For iOS 13.6+ review URL is accessible with the one, used before version 6.0. It drives directly to the review page. Code updated
    NSString * appId = @"{YOUR APP ID}";
    NSString * theUrl = [NSString  stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%@&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software",appId];
    int vers = (int) [[UIDevice currentDevice].systemVersion integerValue];
    if (vers > 6 && vers < 12 ) theUrl = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@",appId];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:theUrl] options:@{} completionHandler:nil];
ETech
  • 1,613
  • 16
  • 17
  • This just seems to display an empty App Store page for me. Seems as though you need to prepend 'id' before the actual ID itself – Gerard May 16 '14 at 22:03
  • are brackets for appId necessary? Cause I forgot to include them and rate function still works fine. – Glenn Posadas Jan 05 '16 at 09:35
  • 1
    use Number except of {YOUR APP ID}, MEANS @"5555555555" - brackets just show that it is a value – ETech Jan 05 '16 at 12:43
26

All above approaches are correct, but nowadays using SKStoreProductViewController leads to better user experience. To use it you need to do the following:

  • implement SKStoreProductViewControllerDelegate protocol in your app delegate
  • add required productViewControllerDidFinish method:

    - (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
      [viewController dismissViewControllerAnimated: YES completion: nil];
    }
    
  • Check if SKStoreProductViewController class is available and either show it or switch to the App Store:

    extern NSString* cAppleID; // must be defined somewhere...
    
    if ([SKStoreProductViewController class] != nil) {
      SKStoreProductViewController* skpvc = [[SKStoreProductViewController new] autorelease];
      skpvc.delegate = self;
      NSDictionary* dict = [NSDictionary dictionaryWithObject: cAppleID forKey: SKStoreProductParameterITunesItemIdentifier];
      [skpvc loadProductWithParameters: dict completionBlock: nil];
      [[self _viewController] presentViewController: skpvc animated: YES completion: nil];
    }
    else {
      static NSString* const iOS7AppStoreURLFormat = @"itms-apps://itunes.apple.com/app/id%@";
      static NSString* const iOSAppStoreURLFormat = @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@";
      NSString* url = [[NSString alloc] initWithFormat: ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f) ? iOS7AppStoreURLFormat : iOSAppStoreURLFormat, cAppleID];
      [[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];
    }
    
Liron
  • 2,012
  • 19
  • 39
deko
  • 2,534
  • 3
  • 34
  • 48
  • 5
    This looked like a great solution, but I have not been able to get this to work. The "Write a Review" button is disabled. I thought at first that this was because I had been running my dev version and thought perhaps the app store version must be installed. So I created an entirely new bundle id and ran it alongside the app store version, and still no luck. Based on this post, it looks like the "Write a Review" button is disabled in iOS 7+ http://stackoverflow.com/questions/19058069/skstoreproductviewcontroller-rate-disabled-on-ios-7 – Matt R Dec 20 '14 at 00:07
  • @MattR it may be because you have not purchased that app. The "Write a Review" button was enabled for me but was not doing anything. I will have to test if it only works if you have purchased the app. – Kamran Khan Jan 22 '15 at 10:33
  • 3
    Any idea how to open the "reviews" tab by default with this implementation? Apple documentation only gives me 3 parameters but none seem to be related to what I need: SKStoreProductParameterITunesItemIdentifier, SKStoreProductParameterAffiliateToken & SKStoreProductParameterCampaignToken – Jovan Mar 03 '15 at 09:13
  • @KamranKhan, I'm seeing the same. I'm wondering if this is disabled in the dev version. Have you tried this in a shipped app (signed) to see if it works? – Shammi Dec 18 '15 at 20:19
  • @Shammi No, I have not checked it. – Kamran Khan Dec 18 '15 at 23:24
  • I'm not sure if this is really a "better user experience" if it doesn't go directly to the Reviews tab for them. It's nice that it doesn't jump out of the app, but that's countered by the extra step the user has to take to get to the review area. Pretty debatable. – Ethan Allen Sep 24 '16 at 20:26
  • Is it possible to place a rating for an app from StoreProductViewController? Doesn't seem possible for me... Would also be great if the Reviews tab could be opened by default – benrudhart Nov 03 '16 at 10:04
  • [SKStoreProductViewController](https://developer.apple.com/documentation/storekit/skstoreproductviewcontroller) is used to display purchase of any media from AppStore. Moreover, it is available from iOS 10.3 in StoreKit.The question here is to display rate/review section on AppStore for which one needs to use [SKStoreReviewController](https://developer.apple.com/documentation/storekit/skstorereviewcontroller). – Harshil Nov 16 '17 at 07:11
17

Solution for iOS 11

Short App Store URLs do not correctly open the "write a review" interface in the new iOS 11 App Store. For example, this does not work:

https://itunes.apple.com/app/id333903271?mt=8&action=write-review

The workaround is to include a two-letter country code and app name in the URL, such as this:

https://itunes.apple.com/us/app/twitter/id333903271?mt=8&action=write-review

or

itms-apps://itunes.apple.com/us/app/twitter/id333903271?mt=8&action=write-review

You can get the full URL of your app from here: https://linkmaker.itunes.apple.com/

This successfully opens the "write a review" interface in the iOS 11 App Store.

Edit: As @Theo mentions below, the country code does not need to be localized and the app name in the URL does not need to be updated if the app name changes.

Hopefully Apple will fix this soon for the shorter URL. See rdar://34498138

neave
  • 2,482
  • 1
  • 26
  • 18
  • 4
    This is the correct way for iOS 11, as introduced in [WWDC Session 303](https://developer.apple.com/videos/play/wwdc2017/303/). Note that the parameter `mt=8` is not required. Further, apparently the country code and the app name in the URL are required, but ignored. So the URL does not need to be localized or updated when the app name changes. – Theo Sep 20 '17 at 21:44
  • @Theo you are correct, only the ID needs to change: `itms-apps://itunes.apple.com/xy/app/foo/id{your_app_id}?action=write-review` – DaveAlden Sep 21 '17 at 08:12
  • 4
    Seriously? How many hours of the WWDC are we required to watch in order to avoid this kind of things ?!? – thibaut noah Sep 21 '17 at 14:25
  • 1
    Just as a note for others, the new deep link is available since iOS 10.3, as said in [WWDC Session 303](https://developer.apple.com/videos/play/wwdc2017/303/). – Kjuly Jun 04 '18 at 03:31
12

Swift 2 version

func jumpToAppStore(appId: String) {
    let url = "itms-apps://itunes.apple.com/app/id\(appId)"
    UIApplication.sharedApplication().openURL(NSURL(string: url)!)
}
Quanlong
  • 24,028
  • 16
  • 69
  • 79
12

There is a new way to do this in iOS 11+ (new app store). You can open the "Write a Review" dialog directly.

iOS 11 example:

itms-apps://itunes.apple.com/us/app/id1137397744?action=write-review

or

https://itunes.apple.com/us/app/id1137397744?action=write-review

Notes:

  • A country code is required (/us/). It can be any country code, doesn't matter.
  • Change the app id (1137397744) to your app id (get it from iTunes URL).
  • If you want to support older iOS version (pre 11), you'll want some conditional logic to only link this way if the OS version is great than or equal to 11.
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
kspearrin
  • 10,238
  • 9
  • 53
  • 82
11

All previous links no more direct to "Reviews" tab,

This link would direct to "Reviews Tab" directly: ​

https://itunes.apple.com/app/viewContentsUserReviews?id=AppID

or ​

itms-apps://itunes.apple.com/app/viewContentsUserReviews?id=AppID

Satinos
  • 179
  • 1
  • 7
  • 1
    There is no official link in Apple Developer Library that directs user to "Reviews Tab". However since ios4 you would find reserved keywords such as viewContentsUserReviews or id that apple still use as url get parameters. If you want to stay on safe side, use the official Link Maker https://linkmaker.itunes.apple.com/en-us/ – Satinos Mar 11 '16 at 13:13
  • 1
    @Ms.Nehal, the question asks for links. They _are_ the actual answer, not a pointer to an answer. – Tobi Nary Mar 12 '16 at 11:59
11

You can use this link in your url launcher function

https://apps.apple.com/app/APP_ID?action=write-review

gtr Developer
  • 2,369
  • 16
  • 12
  • 2
    This is a good answer when sending the link in an email, because if someone opens the link an a desktop or non-Apple device, it still opens a page and shows that the link needs to be opened on a mobile device to make a review. – Manuel Oct 29 '21 at 17:02
10

Using this URL was the perfect solution for me. It takes the user directly to the Write a Review section. Credits to @Joseph Duffy. MUST TRY

URL = itms-apps://itunes.apple.com/gb/app/idYOUR_APP_ID_HERE?action=write-review&mt=8 Replace YOUR_APP_ID_HERE with your AppId

For a sample code try this :

Swift 3, Xcode 8.2.1 :

 let openAppStoreForRating = "itms-apps://itunes.apple.com/gb/app/id1136613532?action=write-review&mt=8"
 if let url = URL(string: openAppStoreForRating), UIApplication.shared.canOpenURL(url) {
      UIApplication.shared.openURL(url)
 } else {
      showAlert(title: "Cannot open AppStore",message: "Please select our app from the AppStore and write a review for us. Thanks!!")
 }

Here showAlert is a custom function for an UIAlertController.

Zonily Jame
  • 5,053
  • 3
  • 30
  • 56
Ankit Kumar Gupta
  • 3,994
  • 4
  • 31
  • 54
  • 2
    Please don't add [the same answer](http://stackoverflow.com/a/42668599/1915448) to multiple questions. Answer the best one and flag the rest as duplicates. See [Is it acceptable to add a duplicate answer to several questions?](http://meta.stackexchange.com/q/104227/347985) – g00glen00b Mar 08 '17 at 10:29
  • 1
    Ok bro thanks. I m new to this and learning. Thanks for guiding will keep this in mind. – Ankit Kumar Gupta Mar 08 '17 at 10:31
9

In iOS7 the URL that switch ur app to App Store for rate and review has changed:

itms-apps://itunes.apple.com/app/idAPP_ID

Where APP_ID need to be replaced with your Application ID.

For iOS 6 and older, URL in previous answers are working fine.

Source: Appirater

Enjoy Coding..!!

Sahil Mahajan
  • 3,922
  • 2
  • 29
  • 43
  • It works on iPhone.. Never tested it on iPad. The link works on iPhone. Try to debug!! – Sahil Mahajan Dec 06 '13 at 17:45
  • 2
    I was getting a white square because I didn't realize you prepend 'id' to your number in the URL. I had just tried ".../app/123123123", and not: ".../app/id123123123". Haha shame on me for not reading correctly. Hope this helps anyone that accidentally did that too. – cclogg Feb 19 '14 at 08:21
7

Starting from iOS 10.3 you can attach action=write-review query item to your https://itunes.apple.com/... and https://appsto.re/... URLs. On iOS 10.3 and up it will open Write a review automatically, while on lower iOS releases will fall back to the app's App Store page.

iOS 11 update: Use Apple's linkmaker: linkmaker.itunes.apple.com and append &action=write-review, seems to be the most safe way to go.

rshev
  • 4,086
  • 1
  • 23
  • 32
4
NSString *url = [NSString stringWithFormat:@"https://itunes.apple.com/us/app/kidsworld/id906660185?ls=1&mt=8"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
pkamb
  • 33,281
  • 23
  • 160
  • 191
Nikunj Patel
  • 304
  • 2
  • 7
4

iOS 4 has ditched the "Rate on Delete" function.

For the time being the only way to rate an application is via iTunes.

Edit: Links can be generated to your applications via iTunes Link Maker. This site has a tutorial.

Kynth
  • 2,597
  • 1
  • 18
  • 24
4

Swift 2 version that actually takes you to the review page for your app on both iOS 8 and iOS 9:

let appId = "YOUR_APP_ID"
let url = "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=\(appId)"

UIApplication.sharedApplication().openURL(NSURL(string: url)!)
user3344977
  • 3,584
  • 4
  • 32
  • 88
3

For >= iOS8: (Simplified @EliBud's answer).

#define APP_STORE_ID 1108885113

- (void)rateApp{
    static NSString *const iOSAppStoreURLFormat = @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d";

    NSURL *appStoreURL = [NSURL URLWithString:[NSString stringWithFormat:iOSAppStoreURLFormat, APP_STORE_ID]];

    if ([[UIApplication sharedApplication] canOpenURL:appStoreURL]) {
        [[UIApplication sharedApplication] openURL:appStoreURL];
    }
}
Mohammad Zaid Pathan
  • 16,304
  • 7
  • 99
  • 130
3

I'm having the same issue in iOS 10 and I could open the iTunes rate section calling:

http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=YOUR_APP_ID&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=7

Basically it changed the last url var to "mt=7"

Cheers

Juanan Jimenez
  • 194
  • 2
  • 7
3

Link to any App in the AppStore via SKStoreProductViewController

It is easy to link to your app at the app store via SKStoreProductViewController. But I struggled a little bit, so I decided to show here the whole process and some code necessary. This technique also makes sure that always the correct store will be used (important for localized apps).

To present the product screen of any app of the app store within your app with any of your apps ViewControllers follow this steps:

  1. Add the StoreKit.framework in your project settings (Target, Build Phases -> Link Binary With Libraries
  2. Import StoreKit into the ViewController class
  3. Make your ViewController conforms this protocol SKStoreProductViewControllerDelegate
  4. Create the method to present the StoreView with the product screen you want
  5. Dismiss the StoreView

But most important: This - for some reason - does not work in the simulator - you have to build and install on a real device with internet connectivity.

  1. Adding the StorKit.framework to your project: Find this in your project settings

SWIFT 4: This is the code according to the described steps ahead:

    // ----------------------------------------------------------------------------------------
// 2. Import StoreKit into the ViewController class
// ----------------------------------------------------------------------------------------
import StoreKit

// ...

// within your ViewController

    // ----------------------------------------------------------------------------------------
    // 4. Create the method to present the StoreView with the product screen you want
    // ----------------------------------------------------------------------------------------
    func showStore() {
        
        // Define parameter for product (here with ID-Number)
        let parameter : Dictionary<String, Any> = [SKStoreProductParameterITunesItemIdentifier : NSNumber(value: 742562928)]
        
        // Create a SKStoreProduktViewController instance
        let storeViewController : SKStoreProductViewController = SKStoreProductViewController()
        
        // set Delegate
        storeViewController.delegate = self
        
        // load product
        storeViewController.loadProduct(withParameters: parameter) { (success, error) in
        
            if success == true {
                // show storeController
                self.present(storeViewController, animated: true, completion: nil)
            } else {
                print("NO SUCCESS LOADING PRODUCT SCREEN")
                print("Error ? : \(error?.localizedDescription)")
            }
        }
    }
    
// ...

// ----------------------------------------------------------------------------------------
// 3. Make your ViewController conforming the protocol SKStoreProductViewControllerDelegate
// ----------------------------------------------------------------------------------------
extension ViewController : SKStoreProductViewControllerDelegate {
    
    // ----------------------------------------------------------------------------------------
    // 5. Dismiss the StoreView
    // ----------------------------------------------------------------------------------------
    func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) {
        print("RECEIVED a FINISH-Message from SKStoreProduktViewController")
        viewController.dismiss(animated: true, completion: nil)
    }
}
Bruno Bieri
  • 9,724
  • 11
  • 63
  • 92
LukeSideWalker
  • 7,399
  • 2
  • 37
  • 45
3

quote from Apple Developer Documentation

In addition, you can continue to include a persistent link in the settings or configuration screens of your app that deep-links to your App Store product page. To automatically open a page on which users can write a review in the App Store, append the query parameter action=write-review to your product URL.

So the URL would be the following:

itms-apps://itunes.apple.com/app/idYOUR_APP_ID?action=write-review

DanLand
  • 31
  • 4
3
let rateUrl = "itms-apps://itunes.apple.com/app/idYOUR_APP_ID?action=write-review"
if UIApplication.shared.canOpenURL(rateUrl) {
    UIApplication.shared.openURL(rateUrl)
}
Zonily Jame
  • 5,053
  • 3
  • 30
  • 56
2

Here is the code that I am using in my app;

-(void)rateApp {

     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[@"itms-apps://itunes.apple.com/app/" stringByAppendingString: @"id547101139"]]]; 
}
2

The accepted answer failed to load the "Reviews" tab. I found below method to load the "Review" tab without "Details" tab.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id={APP_ID}&pageNumber=0&sortOrdering=2&mt=8"]];

Replace {APP_ID} with your app apps store app id.

TharakaNirmana
  • 10,237
  • 8
  • 50
  • 69
2

SWIFT 3

fileprivate func openAppStore() {
        let appId = "YOUR_APP_ID"
        let url_string = "itms-apps://itunes.apple.com/app/id\(appId)"
        if let url = URL(string: url_string) {
            UIApplication.shared.openURL(url)
        }
    }
Vyacheslav
  • 26,359
  • 19
  • 112
  • 194
2

This works fine on iOS 9 - 11.

Haven't tested on earlier versions.

[NSURL URLWithString:@"https://itunes.apple.com/app/idXXXXXXXXXX?action=write-review"];
RainKing
  • 43
  • 6
1

Starting in iOS 10.3:

import StoreKit

func someFunction() {
 SKStoreReviewController.requestReview()
}

but its has been just released with 10.3, so you will still need some fallback method for older versions as described above

Alex
  • 1,061
  • 10
  • 14
1

Swift 5 Tested in iOS14

Opens the review window with 5 stars selected

private func openReviewInAppStore() {
    let rateUrl = "itms-apps://itunes.apple.com/app/idYOURAPPID?action=write-review"
    if UIApplication.shared.canOpenURL(URL.init(string: rateUrl)!) {
        UIApplication.shared.open(URL.init(string: rateUrl)!, options: [:], completionHandler: nil)
    }
}
Diego Jiménez
  • 1,398
  • 1
  • 15
  • 26
0

If your app has been approved for Beta and it's not live then the app review link is available but it won't be live to leave reviews.

  1. Log into iTunes Connect
  2. Click My Apps
  3. Click the App Icon your interested in
  4. Make sure your on the App Store page
  5. Go toApp Information section (it should automatically take you there)
  6. At the bottom of that page there is a blue link that says View on App Store. Click it and it will open to an a blank page. Copy what's in the url bar at the top of the page and that's your app reviews link. It will be live once the app is live.

enter image description here

Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
0

Know you apple app id, it is the numeric digits in your itunes app url after id field.

Something like this : https://itunes.apple.com/app/id148688859, then 148688859 is your app id.

Then, Redirect to this url using your correct app id : https://itunes.apple.com/app/idYOUR_APP_ID?action=write-review.