“评价/评论此应用程序”的应用程序商店链接

发布于 2024-09-07 07:28:37 字数 212 浏览 5 评论 0原文

我想在我的应用程序中添加“评价/评论此应用程序”功能。

有没有办法直接链接到应用程序商店中他们审核应用程序的屏幕?因此,客户无需点击主应用程序链接。谢谢。

编辑:由于缺乏回应,因此开始悬赏。只是为了确保它非常清晰:我知道我可以链接到商店中我的应用程序页面,并要求用户从那里单击到“查看此应用程序”屏幕。问题是是否可以直接链接到“查看此应用程序”屏幕,这样他们就不必点击任何内容。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(30

水水月牙 2024-09-14 07:28:37

对于低于 iOS 7 的版本,请使用旧版本:

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

这对我有效(Xcode 5 - iOS 7 - 设备!):

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

适用于 iOS 8或更高版本:

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

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
薯片软お妹 2024-09-14 07:28:37

更新:

Swift 5.1、Xcode 11

在真实设备 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.
        }
    }
}

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.
        }
    }
}
So尛奶瓶 2024-09-14 07:28:37

编辑:iOS 11解决方案

这是我原来答案的解决方案(见下文)。使用 iOS 11 时,可以使用以下链接格式:

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

只需将 APP_ID 替换为您的特定应用 ID。使链接有效的关键是国家/地区代码。上面的链接使用 us 代码,但实际上使用哪个代码并不重要。用户将自动被重定向到他的商店。

iOS 11 更新:

其他答案中提供的直接进入评论页面的解决方案似乎都不适用于 iOS 11。

最有可能的问题是, iOS 11 App Store 应用程序页面不再有“评论”选项卡。相反,评论现在位于描述和屏幕截图的正下方。当然,仍然可以直接到达此部分(例如使用某种锚点),但苹果似乎不支持/有意这样做。

使用以下链接之一不再有效。他们仍然将用户带到 App Store 应用但只是一个空白页面

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

仍然使用这些链接的每个人都应该尽快更新他们的应用,因为将用户引向空白页面App Store 页面很可能不是您想要的。

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

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

因此,您仍然可以将用户带到您的应用程序商店页面,但不再直接指向评论部分。用户现在必须手动向下滚动到评论部分才能留下反馈。

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

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...

月亮是我掰弯的 2024-09-14 07:28:37

上面写的一切都是正确的。只是一个插入应用程序并将 {YOUR APP ID} 更改为实际应用程序 ID(从 iTunesconnect 获取以显示评论页面)的示例。请注意,正如上面评论的那样,它不适用于模拟器 - 仅适用于设备。

  • 由于 iOS 7 的更改而进行更正。
  • 更正 iOS 10+ openURL 更改
  • 对于 iOS 13.6+,可以使用版本 6.0 之前使用的版本访问审核 URL。它直接进入评论页面。代码已更新
    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];

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];
一身仙ぐ女味 2024-09-14 07:28:37

上述所有方法都是正确的,但现在使用 SKStoreProductViewController 会导致更好的用户体验。要使用它,您需要执行以下操作:

  • 实现 SKStoreProductViewControllerDelegate 应用委托中的协议
  • 添加所需的productViewControllerDidFinish方法:

    - (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
      [viewController解雇ViewControllerAnimated:是完成:nil];
    }
    
  • 检查SKStoreProductViewController类是否可用,并显示它或切换到App Store:

    extern NSString* cAppleID; // 必须在某处定义...
    
    if ([SKStoreProductViewController 类] != nil) {
      SKStoreProductViewController* skpvc = [[SKStoreProductViewController 新] 自动释放];
      skpvc.delegate = 自我;
      NSDictionary* dict = [NSDictionary DictionaryWithObject: cAppleID forKey: SKStoreProductParameterITunesItemIdentifier];
      [skpvc loadProductWithParameters: dict finishBlock: nil];
      [[self _viewController]presentViewController:skpvc动画:YES完成:nil];
    }
    别的 {
      静态 NSString* const iOS7AppStoreURLFormat = @"itms-apps://itunes.apple.com/app/id%@";
      静态 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共享应用程序] openURL: [NSURL URLWithString: url]];
    }
    

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]];
    }
    
七禾 2024-09-14 07:28:37

解决方案

iOS 11短应用商店 URL 无法正确打开新 iOS 11 应用商店中的“撰写评论”界面的 。例如,这不起作用

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

解决方法是包括URL 中的两个字母的国家/地区代码和应用程​​序名称,例如:

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/

这样就成功打开了 iOS 11 App Store 中的“撰写评论”界面。

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

希望苹果能够尽快修复这个较短的 URL。请参阅 rdar://34498138

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

蓝眼泪 2024-09-14 07:28:37

Swift 2 版本

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

Swift 2 version

func jumpToAppStore(appId: String) {
    let url = "itms-apps://itunes.apple.com/app/id\(appId)"
    UIApplication.sharedApplication().openURL(NSURL(string: url)!)
}
音栖息无 2024-09-14 07:28:37

iOS 11+(新应用商店)中有一种新方法可以实现此目的。您可以直接打开“撰写评论”对话框。

iOS 11 示例:

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

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

注释:

  • 需要国家/地区代码 (/us/ )。它可以是任何国家/地区代码,没关系。
  • 将应用程序 ID (1137397744) 更改为您的应用程序 ID(从 iTunes URL 获取)。
  • 如果您想支持较旧的 iOS 版本(11 之前),您将需要一些条件逻辑,仅在操作系统版本大于或等于 11 时才以这种方式链接。

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.
站稳脚跟 2024-09-14 07:28:37

您可以在网址启动器功能中使用此链接

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

You can use this link in your url launcher function

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

﹂绝世的画 2024-09-14 07:28:37

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

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

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

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

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

高跟鞋的旋律 2024-09-14 07:28:37

使用这个 URL 对我来说是完美的解决方案。它将用户直接带到撰写评论部分。感谢@Joseph Duffy。 必须尝试

URL = itms-apps://itunes.apple.com/gb/app/idYOUR_APP_ID_HERE?action=write-review&mt=8
YOUR_APP_ID_HERE 替换为您的 AppId

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

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!!")
 }

这里 showAlert 是 UIAlertController 的自定义函数。

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.

彻夜缠绵 2024-09-14 07:28:37

在 iOS7 中,将您的应用程序切换到 App Store 进行评分和审核的 URL 已更改:

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

其中 APP_ID 需要替换为您的应用程序 ID。

对于 iOS 6 及更早版本,之前答案中的 URL 工作正常。

来源:Appirater

享受编码..!!

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..!!

禾厶谷欠 2024-09-14 07:28:37

从 iOS 10.3 开始,您可以将 action=write-review 查询项附加到您的 https://itunes.apple.com/...https:// /appsto.re/... URL。在 iOS 10.3 及更高版本上,它将自动打开撰写评论,而在较低的 iOS 版本上,它将回退到应用的 App Store 页面。

iOS 11 更新
使用 Apple 的 linkmaker:linkmaker.itunes.apple.com
并附加 &action=write-review 似乎是最安全的方法。

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.

撩发小公举 2024-09-14 07:28:37

iOS 4 放弃了“删除率”功能。

目前,对应用程序进行评级的唯一方法是通过 iTunes。

编辑:可以通过 iTunes Link Maker 生成应用程序的链接。 该网站有一个教程。

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.

秋日私语 2024-09-14 07:28:37
NSString *url = [NSString stringWithFormat:@"https://itunes.apple.com/us/app/kidsworld/id906660185?ls=1&mt=8"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
NSString *url = [NSString stringWithFormat:@"https://itunes.apple.com/us/app/kidsworld/id906660185?ls=1&mt=8"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
北陌 2024-09-14 07:28:37

Swift 2 版本实际上会将您带到 iOS 8 和 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)!)

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)!)
起风了 2024-09-14 07:28:37

对于 >= 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];
    }
}

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];
    }
}
墨洒年华 2024-09-14 07:28:37

我在 iOS 10 中遇到同样的问题,我可以打开 iTunes 费率部分,调用:

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

基本上它将最后一个 url var 更改为“mt=7”

干杯

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

虚拟世界 2024-09-14 07:28:37

引用自 Apple 开发者文档

此外,您可以继续在
您的应用程序的设置或配置屏幕深层链接到您的
应用商店产品页面。自动打开用户所在的页面
可以在App Store写评论,追加查询参数
action=write-review 到您的产品网址。

所以 URL 将如下所示:

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

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

亣腦蒛氧 2024-09-14 07:28:37
let rateUrl = "itms-apps://itunes.apple.com/app/idYOUR_APP_ID?action=write-review"
if UIApplication.shared.canOpenURL(rateUrl) {
    UIApplication.shared.openURL(rateUrl)
}
let rateUrl = "itms-apps://itunes.apple.com/app/idYOUR_APP_ID?action=write-review"
if UIApplication.shared.canOpenURL(rateUrl) {
    UIApplication.shared.openURL(rateUrl)
}
花开浅夏 2024-09-14 07:28:37

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

SKStoreProductViewController 可以轻松链接到应用程序商店中的应用程序。但我有点挣扎,所以我决定在这里展示整个过程和一些必要的代码。此技术还确保始终使用正确的存储(对于本地化应用程序很重要)。

要使用您的任何应用程序 ViewController 在您的应用程序中展示应用程序商店的任何应用程序的产品屏幕,请按照以下步骤操作:

  1. 在您的项目设置添加 StoreKit.framework (Target , 构建阶段 -> 将二进制文件与库链接
  2. 导入 StoreKit 到 ViewController 类
  3. 中使您的 ViewController 符合此协议
    SKStoreProductViewControllerDelegate
  4. 创建方法来呈现 StoreView 以及您想要的产品屏幕
  5. 关闭 StoreView

但最重要的是: - 由于某种原因 - 在模拟器中不起作用 - 您必须在具有互联网连接的真实设备上构建和安装。

  1. 将 StorKit.framework 添加到您的项目中:
    查找此在您的项目设置中

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)
    }
}

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)
    }
}
丑疤怪 2024-09-14 07:28:37

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

-(void)rateApp {

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

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"]]]; 
}
dawn曙光 2024-09-14 07:28:37

接受的答案无法加载“评论”选项卡。我发现下面的方法可以加载没有“详细信息”选项卡的“评论”选项卡。

[[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。

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.

一身软味 2024-09-14 07:28:37

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)
        }
    }

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)
        }
    }
原来分手还会想你 2024-09-14 07:28:37

这在 iOS 9 - 11 上运行良好。

尚未在早期版本上进行测试。

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

This works fine on iOS 9 - 11.

Haven't tested on earlier versions.

[NSURL URLWithString:@"https://itunes.apple.com/app/idXXXXXXXXXX?action=write-review"];
向地狱狂奔 2024-09-14 07:28:37

从 iOS 10.3 开始:

import StoreKit

func someFunction() {
 SKStoreReviewController.requestReview()
}

但它刚刚随 10.3 一起发布,因此您仍然需要一些针对旧版本的回退方法,如上所述

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

夜清冷一曲。 2024-09-14 07:28:37

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)
    }
}

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)
    }
}
贪了杯 2024-09-14 07:28:37

如果您的应用程序已获得测试版批准但尚未上线,则应用程序审核链接可用,但无法留下评论。

  1. 登录 iTunes Connect
  2. 单击我的应用程序
  3. 单击您感兴趣的应用程序图标
  4. 确保您位于App Store 页面
  5. 转到应用程序信息部分(它应该会自动带您到那里)。
  6. 该页面底部有一个蓝色链接,上面写着在App Store上查看。单击它,它将打开一个空白页面。复制页面顶部网址栏中的内容,这就是您的应用评论链接。应用程序上线后,它将上线。

输入图片此处描述

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

知道你的苹果应用程序 ID,它是你的 itunes 应用程序 URL 中 id 字段后面的数字。

像这样的:https://itunes.apple.com/app/id148688859,然后是 148688859是您的应用程序 ID。

然后,使用正确的应用程序 ID 重定向到此网址:https://itunes。 apple.com/app/idYOUR_APP_ID?action=write-review

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.

情泪▽动烟 2024-09-14 07:28:37

对于 SwiftUI,有一种直接询问评论的简单方法。

import SwiftUI
import StoreKit

struct HomeView: View {

    @Environment(\.requestReview) var requestReview

    var body: some View {
                  
        Image(systemName: "star.bubble")
          .resizable()
          .aspectRatio(contentMode: .fit)
          .frame(width:32,height:32)
           .foregroundColor(.orange).onTapGesture {
             requestReview()
        }                
    }
}

For SwiftUI, there is a simple approach for asking reviews directly.

import SwiftUI
import StoreKit

struct HomeView: View {

    @Environment(\.requestReview) var requestReview

    var body: some View {
                  
        Image(systemName: "star.bubble")
          .resizable()
          .aspectRatio(contentMode: .fit)
          .frame(width:32,height:32)
           .foregroundColor(.orange).onTapGesture {
             requestReview()
        }                
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文