应用内购买
我正在构建一个应用程序,用于下载 XML 文件并最终显示财务季度的统计数据。
如果我想添加一个按钮来提示用户允许另外四分之一的数据,我可以简单地向我的应用程序添加一个布尔值,将它们发送到商店,切换标志并允许从我的网站下载更多 XML 文件吗?
网上看了很多文章,但我的头晕! 理想情况下,我希望苹果在购买后处理设备上数据的所有后端恢复:)
任何有用的链接或建议都会很棒:)
I am building an app that downloads an XML file and ultimately presents stats for financial quarters.
If I wish to add a button that prompts the user to allow another quarters worth of data, can I simply add a boolean value to my app, send them to the store, toggle the flag and allow the download of further XML files from my website?
Read many articles on the web, but my head is spinning!
Ideally I would prefer apple to handle all the backend restoration of data on the device once it is purchased :)
Any useful links or advice would be great :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
理论上是的。这取决于您希望该过程的安全程度。
按照您建议的方式,付费内容(您的 XML 文件)仍然可以通过公共互联网下载。您可以对下载进行身份验证,但这需要您的基础设施,而不是苹果的基础设施。
基本上,一旦用户进行应用内购买,您的应用程序就会被发回 a) 交易是否成功,b) 如果成功,则返回 iTunes 收据。
收据至关重要,因为它可以让您验证某人是否确实为他们想要购买的商品付款。大多数开发人员在自己的服务器上实现收据验证(尽管理论上您也可以在设备上执行此操作)。
您可以决定您的应用程序的市场是否足够小而无需这样做。对于人们很可能想要盗版数据的应用程序,也许您需要考虑一些收据验证。
如果您发现第三方服务有点太复杂而无法自行集成,则可以使用第三方服务来简化流程。我自己从未使用过任何服务,但我听说过 Urban Airship 的 IAP 服务:http://urbanairship.com /
In theory, yes. It depends how secure you want the process to be.
In your suggested way, the paid-for content (your XML files) still remain accessible to download across the public internet. You could authenticate the download, but that will require infrastructure on your end, rather than Apple's.
Basically, once a user goes off and makes an in-app purchase your app is sent back a) whether the transaction was successful, and b) if so, an iTunes receipt.
The receipt is critical, since it allows you to verify someone really has paid for the item they're trying to get. Most developers implement receipt validation on their own servers (although you can, in theory, do it on device as well).
You may decide if your app has a sufficiently small market that this isn't required. For apps where it could be quite likely people would want to pirate data, perhaps you want to consider some receipt verification.
It is possible to use a third-party service to simplify the process, if it's something you find a little too complex to integrate yourself. I've never used any myself, but one I've heard reasonable things about is Urban Airship's IAP service: http://urbanairship.com/