OGeek|极客世界-中国程序员成长平台

标题: ios - 如何测试 iOS "Rate My App"功能 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 10:41
标题: ios - 如何测试 iOS "Rate My App"功能

我正在尝试将“评价我的应用”功能添加到尚未发布的 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)

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

非常感谢任何帮助。



Best Answer-推荐答案


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

https://github.com/nicklockwood/iRate

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

我希望这会有所帮助...

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






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4