如何添加一个链接与SWIFT的速度按钮? [英] How can I add a link for a rate button with swift?

查看:120
本文介绍了如何添加一个链接与SWIFT的速度按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我不知道怎么弄的链接之前,我提出我的应用程序,如果链接是每个国家的App Store还是通用?

First I don't know how to get the link before I submit my app, and if the link is for each country app store or is it universal?

然后我不知道这样做的方法就是通过将链接有这样的:

then I don't know if the way to do it is just by putting the link there like:

@IBAction func rate(sender: AnyObject) {
    UIApplication.sharedApplication().openURL(NSURL(string : "webLinkHere")!)
}

或者我应该用另一种方式来做到这一点?

Or should I use another way to do this?

感谢

推荐答案

您可以使用下面的函数,并与您更换的APP_ID。调用此函数将打开应用程序商店的链接的应用程序,用户将看到评论页面,在那里他可以点击,轻松地写评论。

You can use the following function and replace the APP_ID with your one. Calling this function will open the app in app store link and user will see the Review page where he can click and write a review easily.

func rateApp(){
   UIApplication.sharedApplication().openURL(NSURL(string : "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=\(APP_ID)&onlyLatestVersion=true&pageNumber=0&sortOrdering=1)")!);
}

这篇关于如何添加一个链接与SWIFT的速度按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆