Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 79

awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
08/22/13 12:13 AM (12 years ago)

easy in app purchase question - unlocking with either pro version or single purchase

hey guys im having a bit of trouble with the easy in app purchase plugin what im trying to do is use an nsuserdefault code to lock my screen and the user can unlock it by purchasing the screen individually OR purchasing the proversion which unlocks all the features.. is there anybody here who can guide me on how you do it yourself?
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
08/22/13 01:09 AM (12 years ago)
nevermind guys! i found out the solution :D
 
Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
like
08/22/13 02:47 AM (12 years ago)
please share :)
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
08/22/13 05:13 AM (12 years ago)
sure! unfortunately i have no time to explain in detail since i have an meeting to attend to but here goes the simple version i assume that you already know how to implement the easy iap plugin using nsuserdefaults. if not then you can refer to this link (absentia's disable ads tutorial) https://www.buzztouch.com/forum/thread.php?fid=861117A243764FC08CB2D8F&tid=861117A243764FC08CB2D8F it is the same concept i use what i did is i have two easy in app purchase screens 1. easy iap unlock single screen 2. easy iap unlock all screen then i have this code in my goToPurchasedScreen method in easy iap plugin // gets the keyword from buzztouch NSString *lockKeyword = [BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"lockkeyword" defaultValue:@""]; // unlock features [[NSUserDefaults standardUserDefaults] setBool:YES forKey:lockKeyword]; as you can see it has a lockkeyword nsstring, that's because i set it in buzztouch instead of xcode. you can check the buzztouch how to make plugins videos if you need to but i assume you already know this. next, i set up in whatever menu plugin i use the if statement for the nsuserdefault that unlocks the single screen lastly, i set up another if statement nsuserdefault (in the same menu plugin) that checks if the unlock all screen is purchased. if it is then it just unlocks all the other screens this is my specific code: if ([[NSUserDefaults standardUserDefaults] boolForKey:@"unlockAll"]) { // matt unlock features [[NSUserDefaults standardUserDefaults] setBool:YES forKey:lockKeyword]; } i hope this is enough explanation but if you need more specifics i might be able to do it tomorrow. it's actually very simple :)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.