# LHIAPManager **Repository Path**: jiabanwa/LHIAPManager ## Basic Information - **Project Name**: LHIAPManager - **Description**: 一句话解决苹果内购 - **Primary Language**: Objective-C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2020-05-09 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LHIAPManager 一句话解决苹果内购 /** 注意:请在真机做测试,模拟器不行。在真机上做测试的时候,请在设置里面注销自己的真实AppleID。2请将此工程的bundleID替换为你的bundleID。然后再测试内购功能*/ [[LHIAPManager sharedManager] lh_startPurchaseWithProductID:@"你的产品ID" andUrl:LHIAPUrlTest andIAPSuccess:^(NSDictionary *resultDict) { /** 关于内购的状态码,请参考苹果官方文档链接:https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1 */ if ([resultDict[@"status"] intValue]==0) { NSLog(@"内购成功"); /** 在这里向自己的服务器再次验证,做下发道具的操作 */ }else{ NSLog(@"内购失败"); } } andIAPfailure:^(NSError *error) { /** 此error可能包含有用户取消内购或者网络异常引起的错误 */ NSLog(@"内购失败=%@",error.localizedDescription); }];