我想把一个“率/审查这个应用程序”功能到我的应用程序。
是否存在一种方法能够直接链接到应用商店中他们评论应用的屏幕?所以用户不需要点击主应用程序链接。谢谢。
编辑:由于缺乏回应,开始赏金。为了确保这一点非常清楚:我知道我可以链接到应用商店中我的应用页面,并让用户从那里点击到“审查这款应用”屏幕。问题是是否有可能直接链接到“审查这个应用程序”屏幕,这样他们就不需要点击任何东西。
我想把一个“率/审查这个应用程序”功能到我的应用程序。
是否存在一种方法能够直接链接到应用商店中他们评论应用的屏幕?所以用户不需要点击主应用程序链接。谢谢。
编辑:由于缺乏回应,开始赏金。为了确保这一点非常清楚:我知道我可以链接到应用商店中我的应用页面,并让用户从那里点击到“审查这款应用”屏幕。问题是是否有可能直接链接到“审查这个应用程序”屏幕,这样他们就不需要点击任何东西。
当前回答
通过SKStoreProductViewController链接到AppStore中的任何应用程序
很容易通过SKStoreProductViewController链接到应用商店的应用程序。但是我有点纠结,所以我决定在这里展示整个过程和一些必要的代码。这种技术还可以确保始终使用正确的商店(对于本地化应用程序很重要)。
要在你的应用程序商店中显示任何应用程序的产品屏幕,你的任何应用程序ViewControllers遵循以下步骤:
在项目设置中添加StoreKit.framework(目标,构建阶段->链接二进制库 导入StoreKit到ViewController类中 使你的ViewController符合这个协议 SKStoreProductViewControllerDelegate 创建方法,将StoreView显示为所需的产品屏幕 解散StoreView
但最重要的是:出于某种原因,这在模拟器中不起作用——你必须在具有互联网连接的真实设备上构建和安装。
添加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)
}
}
其他回答
上面写的一切都是正确的。这只是一个插入到应用中的示例,并将{YOUR app ID}更改为实际的应用ID,从iTunesconnect中获取,以显示评论页面。请注意,正如上面所评论的,它不能在模拟器上工作-只是在设备上。
修正,因为iOS 7的变化。 修正iOS 10+ openURL更改 对于iOS 13.6+的审查URL是可以访问的,在版本6.0之前使用。它直接开到评论页面。代码更新
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];
通过SKStoreProductViewController链接到AppStore中的任何应用程序
很容易通过SKStoreProductViewController链接到应用商店的应用程序。但是我有点纠结,所以我决定在这里展示整个过程和一些必要的代码。这种技术还可以确保始终使用正确的商店(对于本地化应用程序很重要)。
要在你的应用程序商店中显示任何应用程序的产品屏幕,你的任何应用程序ViewControllers遵循以下步骤:
在项目设置中添加StoreKit.framework(目标,构建阶段->链接二进制库 导入StoreKit到ViewController类中 使你的ViewController符合这个协议 SKStoreProductViewControllerDelegate 创建方法,将StoreView显示为所需的产品屏幕 解散StoreView
但最重要的是:出于某种原因,这在模拟器中不起作用——你必须在具有互联网连接的真实设备上构建和安装。
添加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)
}
}
您可以在url启动器函数中使用此链接
https://apps.apple.com/app/APP_ID?action=write-review
知道你的苹果应用程序id,它是你的itunes应用程序url后id字段的数字。
比如:https://itunes.apple.com/app/id148688859, 148688859是你的应用id。
然后,使用正确的应用程序id重定向到此url: https://itunes.apple.com/app/idYOUR_APP_ID?action=write-review。
在iOS 11+(新的应用商店)中有一种新方法来做到这一点。您可以直接打开“Write a Review”对话框。
以iOS 11为例:
itms-apps://itunes.apple.com/us/app/id1137397744?action=write-review
or
https://itunes.apple.com/us/app/id1137397744?action=write-review
注:
需要国家代码(/us/)。可以是任何国家代码,没关系。 将应用id(1137397744)更改为您的应用id(从iTunes URL获取)。 如果你想要支持旧的iOS版本(11之前),你需要一些条件逻辑,只有当OS版本大于或等于11时才会以这种方式链接。