Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)purchaseSucceeded:(NSNotification*)notification {
- NSString *productIdentifier = (NSString*)notification.object;
- [defaults setBool:YES forKey:productIdentifier];
- [defaults setBool:YES forKey:@"ProductPurchased"];
- [defaults synchronize];
- if ([productIdentifier containsString:@"Pro"]){
- [_buyButton setTitle:@"PURCHASED" forState:UIControlStateNormal];
- for (NSDictionary *dic in dataArray) {
- [defaults setBool:YES forKey:[dic valueForKey:@"identifier"]];
- }
- }
- BOOL isPro = NO;
- int countItem = 0;
- for (NSDictionary *dic in dataArray) {
- NSString *tmpIdentifier = [dic valueForKey:@"identifier"];
- if([defaults boolForKey:tmpIdentifier]) {
- countItem++;
- }else{
- break;
- }
- }
- if(countItem == dataArray.count)
- isPro = YES;
- if (isPro) {
- NSString *filePath = [[NSBundle mainBundle] pathForResource: @"InAPP" ofType:@"plist"];
- NSDictionary *uiInfoDic = [NSDictionary dictionaryWithContentsOfFile:filePath];
- NSString *key = [uiInfoDic valueForKey:@"identifierPro"];
- [defaults setBool:YES forKey:key];
- [_buyButton setTitle:@"PURCHASED" forState:UIControlStateNormal];
- }
- [[NSNotificationCenter defaultCenter] postNotificationName:@"Reload_Collection_View" object:productIdentifier];
- [_tableView reloadData];
- [hud hideAnimated:YES];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement