开发者

How do I restrict previously available functionality with an InApp purchase

I have an app that is completely free. I want to update it with InApp purchases so that some functionality is restricted for purchase, but I also want anyone who has already downloaded the app to date to have all functionality available. I.e. I want to change my app to use InApp purcha开发者_运维百科ses for all future downloads.

I have recorded InApp purchases in NSUserDefaults in the past, but am unsure how I can do the above this way. Is there a way to check the version of my app so I know whether to look for InApp stuff, or is there a way to check date of last update or such things? If not, is there some way logically to check if the user already downloaded once they update (I don't think so)?


You've got to hook this switch in behavior to some leavings from a previous build. So, maybe you wrote files out to the Library directory, maybe you left NSUserData values... Point is, in your new version, first time you launch, look and see if you've made a decision about this before. If not, look to see if there's evidence of earlier runs lying around. If you have them, set a permanent switch in NSUserDefaults saying, "Legacy user! Treat them nice!". Then carry on, sensitive to that switch as you present functionality.

It might also be nice to tell the user that since they're a Customer of Standing, they get the whole featureset, while new users get a limited set that they can flesh out with purchases. More importantly, if they delete your app and re-download it, the app itself will be free, but we won't be able to know they're an old user. So they need to know that and factor that into whatever decision they might eventually make about keeping your app around.


Sell your app as a brand new application and stop selling the old one. People who previously downloaded the old one will continue to have the functionality they purchased and people who download the new app will have less functionality and have to pay.


NSString* vers;
vers = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]; 

gets me the version number stored in the info.plist in NSString form, i.e. "1.2.1". :)

updated: this is not a correct solution. I overlooked that old users would simply be updating to the newer version, so looking at version num doesn't really help determine who's already downloaded the app.

Normally I'd simply delete this wrong answer, but figured better to leave it here so I could look back on it and know what doesn't work in case I try it again!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜