代码之家  ›  专栏  ›  技术社区  ›  William Jockusch

应用商店链接“评价/查看此应用”

  •  176
  • William Jockusch  · 技术社区  · 14 年前

    有没有一种方法可以直接链接到应用商店的屏幕上,他们在那里查看应用程序?这样客户就不必点击主应用程序链接。谢谢。

    编辑:由于缺乏回应,开始悬赏。我知道我可以链接到商店里我的应用程序页面,并要求用户从那里点击“查看这个应用程序”屏幕。问题是是否有可能直接链接到“查看此应用程序”屏幕,这样他们就不必点击任何内容。

    26 回复  |  直到 14 年前
        1
  •  356
  •   Zaid Pathan    8 年前

    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
    

    #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
    
        2
  •  69
  •   Strong84    4 年前

    更新:

    在真实设备iOS 13.0上测试(保证工作)

    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.
            }
        }
    }
    
        3
  •  38
  •   ETech    10 年前

    上面写的一切都是正确的。只需在应用程序中插入一个示例,并将{YOUR app ID}更改为实际的app ID,该示例取自iTunesconnect以显示评论页面。请注意,正如上面所说,它不是在模拟器上工作-只是在设备上。
    -由于ios 7更改而更正。

    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];
    if ([[UIDevice currentDevice].systemVersion integerValue] > 6) theUrl = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@",appId];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:theUrl]];
    
        4
  •  38
  •   Andrei Herford    7 年前

    这是我最初答案的解决方案(见下文)。使用iOS 11时,以下链接格式将起作用:

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

    简单地替换 APP_ID 使用特定的应用程序ID。使链接正常工作的关键是 国家代码 . 上面的链接使用 us 但实际上使用哪种代码并不重要。用户将自动重定向到他的商店。

    iOS 11更新:

    似乎其他答案中提供的直接进入评论页面的解决方案在iOS11上都不起作用。

    最有可能的问题是,iOS11应用程序商店应用程序中的应用程序页确实存在 有一个审查标签了。取而代之的是,评论现在位于描述和屏幕截图的正下方。当然,仍然可以直接到达该段(例如,使用某种锚),但这似乎是可行的 不支持 /由苹果公司设计。

    但只有一页空白

    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
    

    仍然使用这些链接的每个人都应该尽快更新他们的应用程序 ,因为向用户推荐一个空白的应用程序商店页面很可能不是您想要的。

    但是,不指向评论页面而是指向应用程序页面的链接仍然有效,例如。

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

    因此,你仍然可以让用户进入你的应用商店页面,但不再直接进入评论部分。用户现在必须手动向下滚动到“审阅”部分才能留下反馈。

    毫无疑问,这对用户体验来说是一个巨大而令人敬畏的好处,它将帮助开发人员吸引用户留下高质量的评论,而不会打扰他们。干得好苹果。。。

        5
  •  26
  •   Liron    8 年前

    以上方法都是正确的,但是现在使用 SKStoreProductViewController

    • 实施 SKStoreProductViewControllerDelegate 应用程序代理中的协议
    • 添加必填项 ProductViewController完成

      - (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
        [viewController dismissViewControllerAnimated: YES completion: nil];
      }
      
    • 检查是否 类可用,请显示或切换到应用商店:

      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]];
      }
      
        6
  •  15
  •   neave    7 年前

    iOS 11解决方案

    工作:

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

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

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

    您可以从此处获取应用程序的完整URL: https://linkmaker.itunes.apple.com/

    编辑: 正如@Theo在下面提到的,国家代码不需要本地化,如果应用程序名称发生变化,URL中的应用程序名称也不需要更新。

    希望苹果能尽快修复这个短网址。看到了吗 rdar://34498138

        7
  •  12
  •   Quanlong    9 年前

    Swift 2 version

    func jumpToAppStore(appId: String) {
        let url = "itms-apps://itunes.apple.com/app/id\(appId)"
        UIApplication.sharedApplication().openURL(NSURL(string: url)!)
    }
    
        8
  •  11
  •   Satinos    8 年前

    所有以前的链接不再直接指向“评论”选项卡,

    此链接将直接指向“评论选项卡”:

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

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

        9
  •  10
  •   Eric Aya    7 年前

    有一种新的方法可以做到这一点 (新应用商店)。你可以直接打开“写评论”对话框。

    iOS 11示例:

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

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

        10
  •  9
  •   Sahil Mahajan    11 年前

    在iOS7中,将应用程序切换到应用程序商店以进行费率和审核的URL已更改:

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

    其中APP\u ID需要替换为您的应用程序ID。

    对于iOS6和更旧版本,前面的答案中的URL工作正常。

    资料来源: Appirater

    享受编码吧。。!!

        11
  •  9
  •   Zonily Jame    5 年前

    使用这个网址对我来说是完美的解决方案。它直接将用户带到 Write a Review section 必须尝试

    网址= itms-apps://itunes.apple.com/gb/app/idYOUR_APP_ID_HERE?action=write-review&mt=8 替换 你的应用程序ID在这里 用你的 应用程序ID

    对于示例代码,请尝试以下操作:

    Swift 3,代码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!!")
     }
    

    这里showarert是 UIAlertController

        12
  •  7
  •   rshev    7 年前

    从iOS 10.3开始,您可以附加 action=write-review 查询项目到您的 https://itunes.apple.com/... https://appsto.re/... Write a review 在较低的iOS版本中,会自动返回到应用程序的应用程序商店页面。

    : 使用苹果的linkmaker: linkmaker.itunes.apple.com 和附加 &action=write-review ,似乎是最安全的方法。

        13
  •  4
  •   Kynth    14 年前

    编辑:可以通过iTunes Link Maker生成应用程序的链接。 This site has a tutorial.

        14
  •  4
  •   pkamb santoshIOS    9 年前
    NSString *url = [NSString stringWithFormat:@"https://itunes.apple.com/us/app/kidsworld/id906660185?ls=1&mt=8"];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
    
        15
  •  4
  •   user3344977    8 年前

    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)!)
    
        16
  •  3
  •   Zaid Pathan    8 年前

    对于>=iOS8:(简化了@EliBud的答案)。

    #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];
        }
    }
    
        17
  •  3
  •   Juanan Jimenez    8 年前
        18
  •  3
  •   Bruno Bieri    4 年前

    通过SKStoreProductViewController链接到AppStore中的任何应用程序

    要使用任何应用程序ViewController显示应用程序中应用程序商店的任何应用程序的产品屏幕,请执行以下步骤:

    1. 应用程序中的StoreKit.framework 项目设置 (目标,构建阶段->将二进制文件链接到库
    2. 导入存储套件 进入ViewController类
    3. 使ViewController符合此协议
    4. 创建方法以 使用您想要的产品屏幕
    5. 解散 商店视图

    但最重要的是: 这-出于某种原因-不工作的模拟器-你必须建立和安装在一个真正的设备与互联网连接。

    1. 将StorKit.framework添加到项目中: Find this in your project settings

    SWIFT 4:

        // ----------------------------------------------------------------------------------------
    // 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)
        }
    }
    
        19
  •  2
  •   Ahmet Hayrullahoglu    10 年前

    以下是我在应用程序中使用的代码;

    -(void)rateApp {
    
         [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[@"itms-apps://itunes.apple.com/app/" stringByAppendingString: @"id547101139"]]]; 
    }
    
        20
  •  2
  •   TharakaNirmana    8 年前

    接受的答案无法加载“评论”选项卡。我发现下面的方法加载“审查”选项卡没有“细节”选项卡。

    [[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"]];
    

    替换 {APP_ID} 使用你的应用商店应用id。

        21
  •  2
  •   Vyacheslav    8 年前

    雨燕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)
            }
        }
    
        22
  •  2
  •   DanLand    7 年前

    引用 Apple Developer Documentation

    此外,您可以继续在 应用程序的设置或配置屏幕,这些设置或配置屏幕深入链接到 应用商店产品页面。自动打开用户

    itms公司-apps://itunes.apple.com/app/id

        23
  •  2
  •   RainKing    6 年前

    这在iOS9-11上运行良好。

    没有在早期版本上测试过。

    [NSURL URLWithString:@"https://itunes.apple.com/app/idXXXXXXXXXX?action=write-review"];
    
        24
  •  2
  •   Zonily Jame    5 年前
    let rateUrl = "itms-apps://itunes.apple.com/app/idYOUR_APP_ID?action=write-review"
    if UIApplication.shared.canOpenURL(rateUrl) {
        UIApplication.shared.openURL(rateUrl)
    }
    
        25
  •  1
  •   Alex    7 年前

    import StoreKit
    
    func someFunction() {
     SKStoreReviewController.requestReview()
    }
    

        26
  •  0
  •   Lance Samaria    6 年前

    如果你的应用程序已经被批准测试版,但它不是实时的,那么应用程序评论链接是可用的,但它不会实时留下评论。

    1. 登录 iTunes Connect
    2. 点击 My Apps
    3. 单击 App Icon 你对什么感兴趣
    4. App Store 页码
    5. App Information 部分(它会自动将您带到那里)
    6. 在那页的底部有一个蓝色的链接,上面写着 View on App Store . 单击它,它将打开一个空白页。复制页面顶部的url栏中的内容,这就是你的应用程序评论链接。一旦应用程序上线,它就会上线。

    enter image description here

        27
  •  0
  •   Diego Jiménez    4 年前

    Swift 5在iOS14中测试

    打开“查看”窗口,选择5颗星

    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)
        }
    }
    
        28
  •  -1
  •   gtr Developer    3 年前

    您可以在url启动程序函数中使用此链接

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