问题
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?
回答1:
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
.
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's docs are a good read.
来源:https://stackoverflow.com/questions/8498679/what-happens-when-an-app-that-has-in-app-purchase-products-on-it-gets-updated