├── .gitignore ├── LICENSE ├── LxIAPManager ├── LxIAPManager.h └── LxIAPManager.m ├── LxIAPManagerDemo ├── LxIAPManagerDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── LxIAPManagerDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard │ ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /LxIAPManager/LxIAPManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // LxIAPManager.h 3 | // LxIAPManagerDemo 4 | // 5 | 6 | #import 7 | 8 | @class LxIAPManager; 9 | 10 | @protocol LxIAPManagerDelegate 11 | 12 | - (void)iapManager:(LxIAPManager *)iapManager didFetchedProductArray:(NSArray *)productArray; // SKProduct object array 13 | - (void)iapManager:(LxIAPManager *)iapManager fetchProductsFailedForInvalidProductIdentifiers:(NSArray *)invalidProductIdentifiers; 14 | - (void)iapManager:(LxIAPManager *)iapManager didBeginTransaction:(SKPaymentTransaction *)transaction; 15 | - (void)iapManager:(LxIAPManager *)iapManager purchaseSuccessForTransaction:(SKPaymentTransaction *)transaction; 16 | - (void)iapManager:(LxIAPManager *)iapManager purchaseFailedForTransaction:(SKPaymentTransaction *)transaction; 17 | - (void)iapManager:(LxIAPManager *)iapManager hasBeenPurchasedForTransaction:(SKPaymentTransaction *)transaction; 18 | 19 | @end 20 | 21 | @interface LxIAPManager : NSObject 22 | 23 | + (instancetype)defaultManager; 24 | 25 | + (BOOL)iapEnable; 26 | + (NSData *)transactionReceipt; 27 | 28 | @property (nonatomic,assign) id delegate; 29 | 30 | - (void)fetchProductsByIdentifiers:(NSArray *)productIdentifiers; 31 | - (void)purchaseProductWithIdentifier:(NSString *)productIdentifier; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /LxIAPManager/LxIAPManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // LxIAPManager.m 3 | // LxIAPManagerDemo 4 | // 5 | 6 | #import "LxIAPManager.h" 7 | 8 | #define RESTRICT_RESPONSE_WITH_INTERVAL(intervalSeconds) static BOOL responseEnable = YES; \ 9 | if (responseEnable) { \ 10 | responseEnable = NO; \ 11 | dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(intervalSeconds * NSEC_PER_SEC)); \ 12 | dispatch_after(delayTime, dispatch_get_main_queue(), ^(void){ \ 13 | responseEnable = YES; \ 14 | }); \ 15 | } \ 16 | else { \ 17 | return; \ 18 | } 19 | 20 | static CGFloat INTERVAL_SECONDS = 1.0; 21 | 22 | @interface LxIAPManager () 23 | { 24 | id _observer; 25 | } 26 | @end 27 | 28 | @implementation LxIAPManager 29 | 30 | + (instancetype)defaultManager 31 | { 32 | static LxIAPManager * defaultManager = nil; 33 | static dispatch_once_t onceToken = 0; 34 | dispatch_once(&onceToken, ^{ 35 | 36 | defaultManager = [[self alloc]init]; 37 | }); 38 | return defaultManager; 39 | } 40 | 41 | - (instancetype)init 42 | { 43 | self = [super init]; 44 | if (self) { 45 | [[SKPaymentQueue defaultQueue] addTransactionObserver:self]; 46 | _observer = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidEnterBackgroundNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { 47 | 48 | for (SKPaymentTransaction * paymentTransaction in [SKPaymentQueue defaultQueue].transactions) { 49 | [[SKPaymentQueue defaultQueue]finishTransaction:paymentTransaction]; 50 | } 51 | }]; 52 | } 53 | return self; 54 | } 55 | 56 | - (void)dealloc 57 | { 58 | [[SKPaymentQueue defaultQueue] removeTransactionObserver:self]; 59 | [[NSNotificationCenter defaultCenter]removeObserver:_observer]; 60 | _observer = nil; 61 | } 62 | 63 | + (BOOL)iapEnable 64 | { 65 | return [SKPaymentQueue canMakePayments]; 66 | } 67 | 68 | + (NSData *)transactionReceipt 69 | { 70 | NSURL * appStoreReceiptURL = [[NSBundle mainBundle]appStoreReceiptURL]; 71 | return [NSData dataWithContentsOfURL:appStoreReceiptURL]; 72 | } 73 | 74 | #pragma mark - fetch products 75 | 76 | - (void)fetchProductsByIdentifiers:(NSArray *)productIdentifiers 77 | { 78 | if (productIdentifiers.count == 0) { 79 | if ([self.delegate respondsToSelector:@selector(iapManager:fetchProductsFailedForInvalidProductIdentifiers:)]) { 80 | [self.delegate iapManager:self fetchProductsFailedForInvalidProductIdentifiers:@[]]; 81 | } 82 | } 83 | 84 | for (id productIdentifier in productIdentifiers) { 85 | NSCAssert([productIdentifier isKindOfClass:[NSString class]], @"LxIAPManager: productIdentifier type error!"); 86 | } 87 | 88 | SKProductsRequest * productsRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithArray:productIdentifiers]]; 89 | productsRequest.delegate = self; 90 | [productsRequest start]; 91 | } 92 | 93 | - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response 94 | { 95 | if (response.products.count == 0) { 96 | if ([self.delegate respondsToSelector:@selector(iapManager:fetchProductsFailedForInvalidProductIdentifiers:)]) { 97 | [self.delegate iapManager:self fetchProductsFailedForInvalidProductIdentifiers:@[]]; 98 | } 99 | } 100 | else if ([self.delegate respondsToSelector:@selector(iapManager:didFetchedProductArray:)]) { 101 | [self.delegate iapManager:self didFetchedProductArray:response.products]; 102 | } 103 | } 104 | 105 | #pragma mark - purchase product 106 | 107 | - (void)purchaseProductWithIdentifier:(NSString *)productIdentifier 108 | { 109 | RESTRICT_RESPONSE_WITH_INTERVAL(INTERVAL_SECONDS); 110 | 111 | BOOL hasUnfinishedTransactions = NO; 112 | 113 | for (SKPaymentTransaction * paymentTransaction in [SKPaymentQueue defaultQueue].transactions) { 114 | switch (paymentTransaction.transactionState) { 115 | case SKPaymentTransactionStatePurchasing: 116 | { 117 | 118 | } 119 | break; 120 | case SKPaymentTransactionStatePurchased: 121 | { 122 | hasUnfinishedTransactions = YES; 123 | [[SKPaymentQueue defaultQueue]finishTransaction:paymentTransaction]; 124 | } 125 | break; 126 | case SKPaymentTransactionStateFailed: 127 | { 128 | hasUnfinishedTransactions = YES; 129 | [[SKPaymentQueue defaultQueue]finishTransaction:paymentTransaction]; 130 | } 131 | break; 132 | case SKPaymentTransactionStateRestored: 133 | { 134 | hasUnfinishedTransactions = YES; 135 | [[SKPaymentQueue defaultQueue]finishTransaction:paymentTransaction]; 136 | } 137 | break; 138 | case SKPaymentTransactionStateDeferred: 139 | { 140 | 141 | } 142 | break; 143 | default: 144 | break; 145 | } 146 | } 147 | 148 | if (hasUnfinishedTransactions == YES) { 149 | 150 | if ([self.delegate respondsToSelector:@selector(iapManager:purchaseFailedForTransaction:)]) { 151 | [self.delegate iapManager:self purchaseFailedForTransaction:nil]; 152 | } 153 | return; 154 | } 155 | 156 | SKMutablePayment * payment = [[SKMutablePayment alloc]init]; 157 | payment.productIdentifier = productIdentifier; 158 | [[SKPaymentQueue defaultQueue] addPayment:payment]; 159 | } 160 | 161 | - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions 162 | { 163 | for (SKPaymentTransaction * paymentTransaction in transactions) { 164 | 165 | switch (paymentTransaction.transactionState) { 166 | case SKPaymentTransactionStatePurchasing: { 167 | NSLog(@"LxIAPManager: Transaction is being added to the server queue."); 168 | if ([self.delegate respondsToSelector:@selector(iapManager:didBeginTransaction:)]) { 169 | [self.delegate iapManager:self didBeginTransaction:paymentTransaction]; 170 | } 171 | break; 172 | } 173 | case SKPaymentTransactionStatePurchased: { 174 | NSLog(@"LxIAPManager: Transaction is in queue, user has been charged. Client should complete the transaction."); 175 | if ([self.delegate respondsToSelector:@selector(iapManager:purchaseSuccessForTransaction:)]) { 176 | [self.delegate iapManager:self purchaseSuccessForTransaction:paymentTransaction]; 177 | } 178 | [[SKPaymentQueue defaultQueue] finishTransaction:paymentTransaction]; 179 | break; 180 | } 181 | case SKPaymentTransactionStateFailed: { 182 | NSLog(@"LxIAPManager: Transaction was cancelled or failed before being added to the server queue."); 183 | if ([self.delegate respondsToSelector:@selector(iapManager:purchaseFailedForTransaction:)]) { 184 | [self.delegate iapManager:self purchaseFailedForTransaction:paymentTransaction]; 185 | } 186 | [[SKPaymentQueue defaultQueue] finishTransaction:paymentTransaction]; 187 | break; 188 | } 189 | case SKPaymentTransactionStateRestored: { 190 | NSLog(@"LxIAPManager: Transaction was restored from user's purchase history. Client should complete the transaction."); 191 | if ([self.delegate respondsToSelector:@selector(iapManager:hasBeenPurchasedForTransaction:)]) { 192 | [self.delegate iapManager:self hasBeenPurchasedForTransaction:paymentTransaction]; 193 | } 194 | [[SKPaymentQueue defaultQueue] finishTransaction:paymentTransaction]; 195 | break; 196 | } 197 | case SKPaymentTransactionStateDeferred: { 198 | NSLog(@"LxIAPManager: The transaction is in the queue, but its final status is pending external action."); 199 | break; 200 | } 201 | default: { 202 | break; 203 | } 204 | } 205 | } 206 | } 207 | 208 | @end 209 | -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B66219391B53FC520006E967 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B66219381B53FC520006E967 /* main.m */; }; 11 | B662193C1B53FC520006E967 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B662193B1B53FC520006E967 /* AppDelegate.m */; }; 12 | B662193F1B53FC520006E967 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B662193E1B53FC520006E967 /* ViewController.m */; }; 13 | B66219421B53FC520006E967 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B66219401B53FC520006E967 /* Main.storyboard */; }; 14 | B66219441B53FC520006E967 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B66219431B53FC520006E967 /* Images.xcassets */; }; 15 | B66219471B53FC520006E967 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B66219451B53FC520006E967 /* LaunchScreen.xib */; }; 16 | B67996211B5409EF000AB802 /* LxIAPManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B67996201B5409EF000AB802 /* LxIAPManager.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | B66219331B53FC520006E967 /* LxIAPManagerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LxIAPManagerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | B66219371B53FC520006E967 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 22 | B66219381B53FC520006E967 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 23 | B662193A1B53FC520006E967 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 24 | B662193B1B53FC520006E967 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 25 | B662193D1B53FC520006E967 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 26 | B662193E1B53FC520006E967 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 27 | B66219411B53FC520006E967 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | B66219431B53FC520006E967 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 29 | B66219461B53FC520006E967 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 30 | B679961F1B5409EF000AB802 /* LxIAPManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LxIAPManager.h; sourceTree = ""; }; 31 | B67996201B5409EF000AB802 /* LxIAPManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LxIAPManager.m; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | B66219301B53FC520006E967 /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | B662192A1B53FC520006E967 = { 46 | isa = PBXGroup; 47 | children = ( 48 | B66219351B53FC520006E967 /* LxIAPManagerDemo */, 49 | B66219341B53FC520006E967 /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | B66219341B53FC520006E967 /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | B66219331B53FC520006E967 /* LxIAPManagerDemo.app */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | B66219351B53FC520006E967 /* LxIAPManagerDemo */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | B679961E1B5409EF000AB802 /* LxIAPManager */, 65 | B662193A1B53FC520006E967 /* AppDelegate.h */, 66 | B662193B1B53FC520006E967 /* AppDelegate.m */, 67 | B662193D1B53FC520006E967 /* ViewController.h */, 68 | B662193E1B53FC520006E967 /* ViewController.m */, 69 | B66219361B53FC520006E967 /* Supporting Files */, 70 | ); 71 | path = LxIAPManagerDemo; 72 | sourceTree = ""; 73 | }; 74 | B66219361B53FC520006E967 /* Supporting Files */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | B66219451B53FC520006E967 /* LaunchScreen.xib */, 78 | B66219401B53FC520006E967 /* Main.storyboard */, 79 | B66219431B53FC520006E967 /* Images.xcassets */, 80 | B66219371B53FC520006E967 /* Info.plist */, 81 | B66219381B53FC520006E967 /* main.m */, 82 | ); 83 | name = "Supporting Files"; 84 | sourceTree = ""; 85 | }; 86 | B679961E1B5409EF000AB802 /* LxIAPManager */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | B679961F1B5409EF000AB802 /* LxIAPManager.h */, 90 | B67996201B5409EF000AB802 /* LxIAPManager.m */, 91 | ); 92 | name = LxIAPManager; 93 | path = ../../LxIAPManager; 94 | sourceTree = ""; 95 | }; 96 | /* End PBXGroup section */ 97 | 98 | /* Begin PBXNativeTarget section */ 99 | B66219321B53FC520006E967 /* LxIAPManagerDemo */ = { 100 | isa = PBXNativeTarget; 101 | buildConfigurationList = B66219561B53FC520006E967 /* Build configuration list for PBXNativeTarget "LxIAPManagerDemo" */; 102 | buildPhases = ( 103 | B662192F1B53FC520006E967 /* Sources */, 104 | B66219301B53FC520006E967 /* Frameworks */, 105 | B66219311B53FC520006E967 /* Resources */, 106 | ); 107 | buildRules = ( 108 | ); 109 | dependencies = ( 110 | ); 111 | name = LxIAPManagerDemo; 112 | productName = LxIAPManagerDemo; 113 | productReference = B66219331B53FC520006E967 /* LxIAPManagerDemo.app */; 114 | productType = "com.apple.product-type.application"; 115 | }; 116 | /* End PBXNativeTarget section */ 117 | 118 | /* Begin PBXProject section */ 119 | B662192B1B53FC520006E967 /* Project object */ = { 120 | isa = PBXProject; 121 | attributes = { 122 | LastUpgradeCheck = 0640; 123 | ORGANIZATIONNAME = DeveloperLx; 124 | TargetAttributes = { 125 | B66219321B53FC520006E967 = { 126 | CreatedOnToolsVersion = 6.4; 127 | }; 128 | }; 129 | }; 130 | buildConfigurationList = B662192E1B53FC520006E967 /* Build configuration list for PBXProject "LxIAPManagerDemo" */; 131 | compatibilityVersion = "Xcode 3.2"; 132 | developmentRegion = English; 133 | hasScannedForEncodings = 0; 134 | knownRegions = ( 135 | en, 136 | Base, 137 | ); 138 | mainGroup = B662192A1B53FC520006E967; 139 | productRefGroup = B66219341B53FC520006E967 /* Products */; 140 | projectDirPath = ""; 141 | projectRoot = ""; 142 | targets = ( 143 | B66219321B53FC520006E967 /* LxIAPManagerDemo */, 144 | ); 145 | }; 146 | /* End PBXProject section */ 147 | 148 | /* Begin PBXResourcesBuildPhase section */ 149 | B66219311B53FC520006E967 /* Resources */ = { 150 | isa = PBXResourcesBuildPhase; 151 | buildActionMask = 2147483647; 152 | files = ( 153 | B66219421B53FC520006E967 /* Main.storyboard in Resources */, 154 | B66219471B53FC520006E967 /* LaunchScreen.xib in Resources */, 155 | B66219441B53FC520006E967 /* Images.xcassets in Resources */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXResourcesBuildPhase section */ 160 | 161 | /* Begin PBXSourcesBuildPhase section */ 162 | B662192F1B53FC520006E967 /* Sources */ = { 163 | isa = PBXSourcesBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | B662193F1B53FC520006E967 /* ViewController.m in Sources */, 167 | B662193C1B53FC520006E967 /* AppDelegate.m in Sources */, 168 | B67996211B5409EF000AB802 /* LxIAPManager.m in Sources */, 169 | B66219391B53FC520006E967 /* main.m in Sources */, 170 | ); 171 | runOnlyForDeploymentPostprocessing = 0; 172 | }; 173 | /* End PBXSourcesBuildPhase section */ 174 | 175 | /* Begin PBXVariantGroup section */ 176 | B66219401B53FC520006E967 /* Main.storyboard */ = { 177 | isa = PBXVariantGroup; 178 | children = ( 179 | B66219411B53FC520006E967 /* Base */, 180 | ); 181 | name = Main.storyboard; 182 | sourceTree = ""; 183 | }; 184 | B66219451B53FC520006E967 /* LaunchScreen.xib */ = { 185 | isa = PBXVariantGroup; 186 | children = ( 187 | B66219461B53FC520006E967 /* Base */, 188 | ); 189 | name = LaunchScreen.xib; 190 | sourceTree = ""; 191 | }; 192 | /* End PBXVariantGroup section */ 193 | 194 | /* Begin XCBuildConfiguration section */ 195 | B66219541B53FC520006E967 /* Debug */ = { 196 | isa = XCBuildConfiguration; 197 | buildSettings = { 198 | ALWAYS_SEARCH_USER_PATHS = NO; 199 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 200 | CLANG_CXX_LIBRARY = "libc++"; 201 | CLANG_ENABLE_MODULES = YES; 202 | CLANG_ENABLE_OBJC_ARC = YES; 203 | CLANG_WARN_BOOL_CONVERSION = YES; 204 | CLANG_WARN_CONSTANT_CONVERSION = YES; 205 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 206 | CLANG_WARN_EMPTY_BODY = YES; 207 | CLANG_WARN_ENUM_CONVERSION = YES; 208 | CLANG_WARN_INT_CONVERSION = YES; 209 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 210 | CLANG_WARN_UNREACHABLE_CODE = YES; 211 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 212 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 213 | COPY_PHASE_STRIP = NO; 214 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 215 | ENABLE_STRICT_OBJC_MSGSEND = YES; 216 | GCC_C_LANGUAGE_STANDARD = gnu99; 217 | GCC_DYNAMIC_NO_PIC = NO; 218 | GCC_NO_COMMON_BLOCKS = YES; 219 | GCC_OPTIMIZATION_LEVEL = 0; 220 | GCC_PREPROCESSOR_DEFINITIONS = ( 221 | "DEBUG=1", 222 | "$(inherited)", 223 | ); 224 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 225 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 226 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 227 | GCC_WARN_UNDECLARED_SELECTOR = YES; 228 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 229 | GCC_WARN_UNUSED_FUNCTION = YES; 230 | GCC_WARN_UNUSED_VARIABLE = YES; 231 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 232 | MTL_ENABLE_DEBUG_INFO = YES; 233 | ONLY_ACTIVE_ARCH = YES; 234 | SDKROOT = iphoneos; 235 | TARGETED_DEVICE_FAMILY = "1,2"; 236 | }; 237 | name = Debug; 238 | }; 239 | B66219551B53FC520006E967 /* Release */ = { 240 | isa = XCBuildConfiguration; 241 | buildSettings = { 242 | ALWAYS_SEARCH_USER_PATHS = NO; 243 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 244 | CLANG_CXX_LIBRARY = "libc++"; 245 | CLANG_ENABLE_MODULES = YES; 246 | CLANG_ENABLE_OBJC_ARC = YES; 247 | CLANG_WARN_BOOL_CONVERSION = YES; 248 | CLANG_WARN_CONSTANT_CONVERSION = YES; 249 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 250 | CLANG_WARN_EMPTY_BODY = YES; 251 | CLANG_WARN_ENUM_CONVERSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 254 | CLANG_WARN_UNREACHABLE_CODE = YES; 255 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 256 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 257 | COPY_PHASE_STRIP = NO; 258 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 259 | ENABLE_NS_ASSERTIONS = NO; 260 | ENABLE_STRICT_OBJC_MSGSEND = YES; 261 | GCC_C_LANGUAGE_STANDARD = gnu99; 262 | GCC_NO_COMMON_BLOCKS = YES; 263 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 264 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 265 | GCC_WARN_UNDECLARED_SELECTOR = YES; 266 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 267 | GCC_WARN_UNUSED_FUNCTION = YES; 268 | GCC_WARN_UNUSED_VARIABLE = YES; 269 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 270 | MTL_ENABLE_DEBUG_INFO = NO; 271 | SDKROOT = iphoneos; 272 | TARGETED_DEVICE_FAMILY = "1,2"; 273 | VALIDATE_PRODUCT = YES; 274 | }; 275 | name = Release; 276 | }; 277 | B66219571B53FC520006E967 /* Debug */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 281 | INFOPLIST_FILE = LxIAPManagerDemo/Info.plist; 282 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 283 | PRODUCT_NAME = "$(TARGET_NAME)"; 284 | }; 285 | name = Debug; 286 | }; 287 | B66219581B53FC520006E967 /* Release */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 291 | INFOPLIST_FILE = LxIAPManagerDemo/Info.plist; 292 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | }; 295 | name = Release; 296 | }; 297 | /* End XCBuildConfiguration section */ 298 | 299 | /* Begin XCConfigurationList section */ 300 | B662192E1B53FC520006E967 /* Build configuration list for PBXProject "LxIAPManagerDemo" */ = { 301 | isa = XCConfigurationList; 302 | buildConfigurations = ( 303 | B66219541B53FC520006E967 /* Debug */, 304 | B66219551B53FC520006E967 /* Release */, 305 | ); 306 | defaultConfigurationIsVisible = 0; 307 | defaultConfigurationName = Release; 308 | }; 309 | B66219561B53FC520006E967 /* Build configuration list for PBXNativeTarget "LxIAPManagerDemo" */ = { 310 | isa = XCConfigurationList; 311 | buildConfigurations = ( 312 | B66219571B53FC520006E967 /* Debug */, 313 | B66219581B53FC520006E967 /* Release */, 314 | ); 315 | defaultConfigurationIsVisible = 0; 316 | defaultConfigurationName = Release; 317 | }; 318 | /* End XCConfigurationList section */ 319 | }; 320 | rootObject = B662192B1B53FC520006E967 /* Project object */; 321 | } 322 | -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LxIAPManagerDemo 4 | // 5 | 6 | #import 7 | 8 | @interface AppDelegate : UIResponder 9 | 10 | @property (strong, nonatomic) UIWindow *window; 11 | 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LxIAPManagerDemo 4 | // 5 | 6 | #import "AppDelegate.h" 7 | 8 | @interface AppDelegate () 9 | 10 | @end 11 | 12 | @implementation AppDelegate 13 | 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 16 | 17 | return YES; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | etiantian.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LxIAPManagerDemo 4 | // 5 | 6 | #import 7 | 8 | @interface ViewController : UIViewController 9 | 10 | 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // LxIAPManagerDemo 4 | // 5 | 6 | #import "ViewController.h" 7 | 8 | @interface ViewController () 9 | 10 | @end 11 | 12 | @implementation ViewController 13 | 14 | - (void)viewDidLoad { 15 | [super viewDidLoad]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /LxIAPManagerDemo/LxIAPManagerDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LxIAPManagerDemo 4 | // 5 | 6 | #import 7 | #import "AppDelegate.h" 8 | 9 | int main(int argc, char * argv[]) { 10 | @autoreleasepool { 11 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LxIAPManager 2 | * Apple IAP capsulation. 3 | 4 | ### Installation 5 | You only need drag LxIAPManager.h and LxIAPManager.m to your project. 6 | 7 | ### Podfile 8 | pod 'LxIAPManager', '~> 1.0.0' 9 | 10 | ### Support 11 | Minimum support iOS version: iOS 7.0 12 | 13 | ### Usage 14 | 15 | // First, implement LxIAPManager protocol in your class. 16 | 17 | BOOL iapEnable = [LxIAPManager iapEnable]; 18 | NSData * transactionReceipt = [LxIAPManager transactionReceipt]; 19 | 20 | [LxIAPManager defaultManager].delegate = self; 21 | 22 | [[LxIAPManager defaultManager]fetchProductsByIdentifiers:@[PRODUCT_IDENTIFIER_1, PRODUCT_IDENTIFIER_2]]; 23 | [[LxIAPManager defaultManager]purchaseProductWithIdentifier:PRODUCT_IDENTIFIER_2]; 24 | 25 | #pragma mark - protocol method 26 | 27 | - (void)iapManager:(LxIAPManager *)iapManager didFetchedProductArray:(NSArray *)productArray 28 | { 29 | // fetched valid product info. 30 | } 31 | 32 | - (void)iapManager:(LxIAPManager *)iapManager fetchProductsFailedForInvalidProductIdentifiers:(NSArray *)invalidProductIdentifiers 33 | { 34 | // fetched product info failed. 35 | } 36 | 37 | - (void)iapManager:(LxIAPManager *)iapManager didBeginTransaction:(SKPaymentTransaction *)transaction 38 | { 39 | // a transaction did begin. 40 | } 41 | 42 | - (void)iapManager:(LxIAPManager *)iapManager purchaseSuccessForTransaction:(SKPaymentTransaction *)transaction 43 | { 44 | // a transaction paid successful. 45 | // next, verify it by apple server. 46 | } 47 | 48 | - (void)iapManager:(LxIAPManager *)iapManager purchaseFailedForTransaction:(SKPaymentTransaction *)transaction 49 | { 50 | // a transaction paid failed. 51 | } 52 | 53 | - (void)iapManager:(LxIAPManager *)iapManager hasBeenPurchasedForTransaction:(SKPaymentTransaction *)transaction 54 | { 55 | // the product has purchased, recover it. 56 | } 57 | 58 | ### License 59 | LxIAPManager is available under the Apache License 2.0. See the LICENSE file for more info. --------------------------------------------------------------------------------