In-App Purchase Autorenewable Subscription Manager
- JJSubscriptionManager is a drop-in singleton used for managing autorenewable subscriptions, a type of in-app purchase for iOS.
- It's good for iOS7 and up. This singleton does not support manual receipt validation which was required in iOS6 and earlier.
- Setting up JJSubscriptionManager is pretty straight forward. It requires at minimum the following 3 steps.
- Create
ProductIdentifiers.plist
to track Product Identifiers and add to main xcodeproj
[JJSubscriptionManager sharedManager];
- Get a list of products
NSArray *products = [[JJSubscriptionManager sharedManager] products];
- Make the purchase
SKProduct *autorenewableProduct = products[0];
NSError *pretransactionError = nil;
BOOL purchaseStarted = [[JJSubscriptionManager sharedManager] buyProductWithIdentifier:autorenewableProduct.productIdentifier
completion:^(BOOL success, NSError *error) {
if (!success) {
NSLog(@"NEGATIVE GHOST RIDER");
}
}
error:&pretransactionError];
- Verify subscription is active
[[JJSubscriptionManager sharedManager] isSubscriptionActive];
- Determine Mac OS X compatibility
- Remove need for plist
- Support more than 1 autorenewable subscription