当应用内购买产品的应用程序得到更新时会发生什么? [英] what happens when an app that has in-app purchase products on it gets updated?

查看:126
本文介绍了当应用内购买产品的应用程序得到更新时会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为应用程序更新后,程序员需要跟踪IAP吗?我是否必须将文件写入文件文件夹,说明已购买IAP,然后在应用程序更新后检查代码是否存在?我现在有一个可以提供应用内购买的应用,而且我打算发布更新,但购买IAP的用户会怎样?

I suppose it's up to the programmer to keep track of IAPs after the app is updated? Would I have to write a file to the documents folder saying the IAP was purchased, and then have the code check to see if the file's there once the app updates? I have an app out now that has in-app purchases available, and I'm planning on releasing an update, but what will happen to users that purchased IAPs?

推荐答案

Apple会跟踪用户的应用内购买情况。您可以在 ApplicationDidFinishLaunching 中询问Apple当前用户的应用内购买情况。

Apple keeps track of in-app-purchases that your users make. You can ask Apple about the in-app-purchases for the current user in ApplicationDidFinishLaunching.

您可以在 NSUserDefaults 或密钥链中跟踪应用内购买状态。这样您就不需要经常查询Apple了。请记住,如果从设备中删除应用程序, NSUserDefaults 将被清除(因此应用程序应始终在 ApplicationDidFinishLaunching

You can keep track of in-app-purchase status in NSUserDefaults or perhaps the keychain. This way you don't need to constantly query Apple. Keep in mind if the app is deleted from the device the NSUserDefaults will be wiped out (so the app should always ask Apple in ApplicationDidFinishLaunching.

Apple的文档很好读。

这篇关于当应用内购买产品的应用程序得到更新时会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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