I have this new app I am creating that will use consumable in-app purchases.
My question is this: how does that work? I mean, imagine the user buys a consumable stuf
For people who come hare searching for the way to store consumable items locally in iOS, have a look at PDKeychainBindingsController (https://github.com/carlbrown/PDKeychainBindingsController).
It works like NSUserDefaults and can be used to store the purchased consumable item count in iDevice's keychain (the items stored in keychain do not get removed while deleting the app.).
Use the code something like below to store and retrieve the value from keychain:
- (NSUInteger)hintCount {
PDKeychainBindings *wrapper=[PDKeychainBindings sharedKeychainBindings];
NSString *valueString = [wrapper objectForKey:@"hintCount"];
int value = [valueString intValue];
return value;
}
- (void)setHintCount:(NSUInteger)starCount {
PDKeychainBindings *wrapper=[PDKeychainBindings sharedKeychainBindings];
NSString *valueString = [NSString stringWithFormat:@"%i",starCount];
[wrapper setObject:valueString forKey:@"hintCount"];
}