Skip to content

Commit

Permalink
iOS 6.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro committed Mar 10, 2015
1 parent f64f04b commit e01633e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/atomic/ios/LDInAppService.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = 'LDInAppService'
s.version = '1.0.2'
s.version = '1.0.3'
s.author = { 'Imanol Fernandez' => 'imanolf@ludei.com' }
s.homepage = 'https://github.com/ludei/atomic-plugins-inapps'
s.summary = 'LDInAppService class provides an easy to use and secure In-App Purchase API'
s.license = 'MPL 2.0'
s.source = { :git => 'https://github.com/ludei/atomic-plugins-inapps.git', :tag => '1.0.2' }
s.source = { :git => 'https://github.com/ludei/atomic-plugins-inapps.git', :tag => '1.0.3' }
s.source_files = 'src/atomic/ios/appstore'
s.platform = :ios
s.ios.deployment_target = '5.0'
Expand Down
8 changes: 6 additions & 2 deletions src/atomic/ios/appstore/LDInAppService.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProdu
}
_completion(response.products, error);
request.delegate = nil;
CFAutorelease((__bridge CFTypeRef)(self));
LDInAppFetchDelegate * this = self;
//simulate CFAutoRelease for iOS 6
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
CFRelease((__bridge CFTypeRef)(this));
});
}

@end
Expand Down Expand Up @@ -198,7 +202,7 @@ -(void) fetchProducts: (NSArray *) productIds completion:(void(^)(NSArray * prod
completion(products, error);
}
};
//CFRetain((__bridge CFTypeRef)(delegate));
CFRetain((__bridge CFTypeRef)(delegate));
request.delegate = delegate;
[request start];
}
Expand Down
2 changes: 1 addition & 1 deletion src/cordova/ios/appstore/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="com.ludei.inapps.ios.appstore" version="1.0.3">
id="com.ludei.inapps.ios.appstore" version="1.0.4">
<name>InAppsAppStore</name>
<description>iOS In-App Purchase API</description>
<license>MPL 2.0</license>
Expand Down
8 changes: 6 additions & 2 deletions src/cordova/ios/appstore/src/deps/LDInAppService.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProdu
}
_completion(response.products, error);
request.delegate = nil;
CFAutorelease((__bridge CFTypeRef)(self));
LDInAppFetchDelegate * this = self;
//simulate CFAutoRelease for iOS 6
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
CFRelease((__bridge CFTypeRef)(this));
});
}

@end
Expand Down Expand Up @@ -198,7 +202,7 @@ -(void) fetchProducts: (NSArray *) productIds completion:(void(^)(NSArray * prod
completion(products, error);
}
};
//CFRetain((__bridge CFTypeRef)(delegate));
CFRetain((__bridge CFTypeRef)(delegate));
request.delegate = delegate;
[request start];
}
Expand Down

0 comments on commit e01633e

Please sign in to comment.