I have had a couple of apps that are approved and available in iTunes. I tested them on an iPad 2 with iOS 5.0. They are some features that are unlocked through in-app purchases in those apps. Once the user successfully buys a certain feature, I check to make sure the transaction was successful and i unlock it by setting a NSUserDefaults variable.
Recently some of my iPad 3 users have been complaining that they buy a feature and it is still unlocked. I don't own iPad 3 so I tested the released code on iPad 2 and it works just fine.
Has anyone else experienced the same issue with iPad 3? Is there some bug or problem with NSUserDefaults in iOS 5.1?
Here is the code
NSArray *stringsArray2a = [[NSArray alloc] initWithObjects: @"1", nil];
[[NSUserDefaults standardUserDefaults] setObject:stringsArray2a forKey:@"MyAppWeatherPackStr"];
[[NSUserDefaults standardUserDefaults] synchronize];
Then I check for it like this
NSArray *purchasedAppArray = [[NSUserDefaults standardUserDefaults] objectForKey:@"MyAppWeatherPackStr"];
NSString *purchasedAppStr = [purchasedAppArray objectAtIndex:0];
if([purchasedAppStr isEqualToString:@"1"])
{
//all good keep checking weather
}
else
{
//can't check weather
}