简体   繁体   English

带有应用内购买商品的应用被更新时会发生什么?

[英]what happens when an app that has in-app purchase products on it gets updated?

I suppose it's up to the programmer to keep track of IAPs after the app is updated? 我想由应用程序更新后由程序员来跟踪IAP吗? 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? 我是否必须将文件写入购买IAP的文件文件夹,然后在应用更新后进行代码检查以查看文件是否在那里? 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? 我现在有一个可以使用应用程序内购买功能的应用程序,并且正计划发布更新,但是购买IAP的用户会怎样?

Apple keeps track of in-app-purchases that your users make. Apple会跟踪用户进行的应用内购买。 You can ask Apple about the in-app-purchases for the current user in ApplicationDidFinishLaunching . 您可以在ApplicationDidFinishLaunching向Apple查询当前用户的ApplicationDidFinishLaunching内购买。

You can keep track of in-app-purchase status in NSUserDefaults or perhaps the keychain. 您可以在NSUserDefaults或钥匙串中跟踪应用程序内购买状态。 This way you don't need to constantly query Apple. 这样,您就不必不断查询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 . 请记住,如果从设备中删除了该应用程序, NSUserDefaults将被清除(因此该应用程序应始终在ApplicationDidFinishLaunching询问苹果。

Apple's docs are a good read. 苹果的文档非常好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM