gpt4 book ai didi

ios - 如何测试 iOS "Rate My App"功能

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:58:09 26 4
gpt4 key购买 nike

我正在尝试向尚未发布的 iOS 应用程序添加“评价我的应用程序”功能。

我有一个简单的函数,如下所示:

 let alert = UIAlertController(title: "Rate Us", message: "Thanks for using <APP NAME>", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Rate <APP NAME>", style: UIAlertActionStyle.Default, handler: { alertAction in
UIApplication.sharedApplication().openURL(NSURL(string : "itms-apps://itunes.apple.com/app/<ITUNES CONNECT APP ID>")!)
alert.dismissViewControllerAnimated(true, completion: nil)
}))
alert.addAction(UIAlertAction(title: "No Thanks", style: UIAlertActionStyle.Default, handler: { alertAction in
NSUserDefaults.standardUserDefaults().setBool(true, forKey: "neverRate")
alert.dismissViewControllerAnimated(true, completion: nil)
}))
alert.addAction(UIAlertAction(title: "Maybe Later", style: UIAlertActionStyle.Default, handler: { alertAction in
alert.dismissViewControllerAnimated(true, completion: nil)
}))
self.presentViewController(alert, animated: true, completion: nil)

我如何测试这是否有效?

我的应用程序尚未提交,我想确保代码正常运行。

我收到提醒,当我点击“给我们评分”时,它会将我重定向到应用商店:

App Store Image Shown

控制台错误:

2016-02-24 18:38:00.302 <APP NAME>[2212:808041] _BSMachError: (os/kern) invalid capability (20)
2016-02-24 18:38:00.305 <APP NAME>[2212:808256] _BSMachError: (os/kern) invalid name (15)

我不确定这是否意味着该功能不起作用或其他原因。

非常感谢任何帮助。

最佳答案

有一个出色的库可以满足您的需求。您可以使用 iRate 库。所有的细节都可以从下面的链接中找到

https://github.com/nicklockwood/iRate

库会检查用户是否审查过特定版本,如果没有,它会提示用户对应用进行评分。可以配置提示警报的周期。如果您在商店中有一个实时应用程序,也可以在开发时测试该功能。

我希望这有助于...

关于ios - 如何测试 iOS "Rate My App"功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35615501/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com