First of all you do not need to know who has actually referring to the link. As the question is that you only want to give bonuses to people that shares a link, this could be solved in some different ways. If you are actually want to know if the receiver actually clicked on the link, it is much harder. Thus my answer is only for the situation that only sharing is the important thing.
One way to achieve this is to use the MFMailComposeViewController with a pre-defined text that contains a link to your application. When the view is dismissed you can check if the user cancelled or not, you could also check that it worked OK. If this is true, the user has actually sent an e-mail with your link. You do this by implementing MFMailComposeViewControllerDelegate and checking the result.
You could also choose to send an SMS and do a similar test or check. Check out this article that shows how to send SMS programatically.
Another way of solving this is to let your application communicate to a server that you have implemented. The server could either send an e-mail or use an SMS service to send an SMS. The SMS solution would of course cost you some money.
发布评论
评论(1)
首先,您不需要知道谁实际引用了该链接。由于问题是您只想向共享链接的人提供奖金,因此可以通过一些不同的方式来解决这个问题。如果您确实想知道接收者是否确实点击了链接,那就困难得多。所以我的回答只是针对只有分享才是重要的情况。
实现此目的的一种方法是将 MFMailComposeViewController 与包含应用程序链接的预定义文本一起使用。当视图被关闭时,您可以检查用户是否取消,您还可以检查它是否正常工作。如果这是真的,则用户实际上已经发送了一封包含您的链接的电子邮件。您可以通过实现MFMailComposeViewControllerDelegate并检查结果来完成此操作。
您还可以选择发送短信并进行类似的测试或检查。请查看这篇文章,其中介绍了如何以编程方式发送短信。
解决此问题的另一种方法是让您的应用程序与您已实现的服务器进行通信。服务器可以发送电子邮件或使用 SMS 服务发送 SMS。 SMS 解决方案当然会花费您一些钱。
First of all you do not need to know who has actually referring to the link. As the question is that you only want to give bonuses to people that shares a link, this could be solved in some different ways. If you are actually want to know if the receiver actually clicked on the link, it is much harder. Thus my answer is only for the situation that only sharing is the important thing.
One way to achieve this is to use the MFMailComposeViewController with a pre-defined text that contains a link to your application. When the view is dismissed you can check if the user cancelled or not, you could also check that it worked OK. If this is true, the user has actually sent an e-mail with your link. You do this by implementing MFMailComposeViewControllerDelegate and checking the result.
You could also choose to send an SMS and do a similar test or check. Check out this article that shows how to send SMS programatically.
Another way of solving this is to let your application communicate to a server that you have implemented. The server could either send an e-mail or use an SMS service to send an SMS. The SMS solution would of course cost you some money.