|
@@ -29,20 +29,24 @@ NSString *const KMItunesServer = @"https://store.filmagepro.com:3018/api/subscri
|
|
NSString *const KMStoreReceipt = @"KMStoreReceiptKey";
|
|
NSString *const KMStoreReceipt = @"KMStoreReceiptKey";
|
|
|
|
|
|
/** PDF Reader Pro 免费版*/
|
|
/** PDF Reader Pro 免费版*/
|
|
-NSString * const KMMonthLicenseProductIdentifier = @"com.pdfreaderpro.mac_free.member.all_access_pack_6months.001"; // 产品名称:all_access_pack_6months
|
|
|
|
-NSString * const KMYearLicenseProductIdentifier = @"com.pdfreaderpro.mac_free.member.all_access_pack_12months.001"; // 产品名称:all_access_pack_12months
|
|
|
|
-NSString * const KMNewMonthLicenseProductIdentifier = @"com.pdfreaderpro.mac_free.member.all_access_pack_new_6months.001"; // 产品名称:all_access_pack_new_6months
|
|
|
|
-NSString * const KM4DevicesAllAccessPackNew6Months = @"com.pdfreaderpro.mac_free.member.all_access_pack_advanced_annual.001"; // 产品名称:4_devices_all_access_pack_new_6months
|
|
|
|
-NSString * const KM4DevicesAllAccessPack12months = @"com.pdfreaderpro.mac_free.member.all_access_pack_new_6months.001"; // 产品名称:4_devices_all_access_pack_12month
|
|
|
|
-
|
|
|
|
-// 多设备包订阅
|
|
|
|
-NSString * const KMLiteAdvancedAddDevicesAllAccessPack12Months = @"com.pdfreaderpro.mac_free.member.advanced_add_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_devices_all_access_pack_12months
|
|
|
|
-NSString * const KMLiteAdvancedAdd2DevicesAllAccessPack12Months = @"com.pdfreaderpro.mac_free.member.advanced_add_2_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_2_devices_all_access_pack_12months
|
|
|
|
-
|
|
|
|
|
|
+NSString * const KMMonthLicenseProductIdentifier_Free = @"com.pdfreaderpro.mac_free.member.all_access_pack_6months.001"; // 产品名称:all_access_pack_6months(订阅)
|
|
|
|
+NSString * const KMYearLicenseProductIdentifier_Free = @"com.pdfreaderpro.mac_free.member.all_access_pack_12months.001"; // 产品名称:all_access_pack_12months(订阅)
|
|
|
|
+NSString * const KMNewMonthLicenseProductIdentifier_Free = @"com.pdfreaderpro.mac_free.member.all_access_pack_new_6months.001"; // 产品名称:all_access_pack_new_6months(订阅)
|
|
|
|
+NSString * const KM4DevicesAllAccessPackNew6Months_Free = @"com.pdfreaderpro.mac_free.member.all_access_pack_advanced_6months.001"; // 产品名称:4_devices_all_access_pack_new_6months(订阅)
|
|
|
|
+NSString * const KM4DevicesAllAccessPack12Months_Free = @"com.pdfreaderpro.mac_free.member.all_access_pack_advanced_annual.001"; // 产品名称:4_devices_all_access_pack_12month(订阅)
|
|
|
|
+NSString * const KMAIAllAccessPack1Month_Free = @"com.pdfreaderpro.mac_free.member.ai_pack_1_month"; // 产品名称:ai_all_access_pack_1month(订阅)
|
|
|
|
+NSString * const KMAIAllAccessPack12Month_Free = @"com.pdfreaderpro.mac_free.member.ai_pack_12_month"; // 产品名称:ai_all_access_pack_12month(订阅)
|
|
|
|
+NSString * const KMAllAccessPackPermanen_Freet = @"com.pdfreaderpro.mac_free.member.all_access_pack_advanced_permanent_license.001"; // 产品名称:all_access_pack_permanent(永久)
|
|
|
|
+NSString * const KMAdvancedAddDevicesAllAccessPack12Months_Free = @"com.pdfreaderpro.mac_free.member.advanced_add_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_devices_all_access_pack_12months(多设备包订阅)
|
|
|
|
+NSString * const KMAdvancedAdd2DevicesAllAccessPack12Months_Free = @"com.pdfreaderpro.mac_free.member.advanced_add_2_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_2_devices_all_access_pack_12months(多设备包订阅)
|
|
/** PDF Reader Pro 付费版*/
|
|
/** PDF Reader Pro 付费版*/
|
|
-NSString * const KMStandardAddDevicesAllAccessPack12Months = @"com.pdfreaderpro.mac.standard_add_devices_all_access_pack_advanced_annual.001"; // 产品名称:standard_add_devices_all_access_pack_12months
|
|
|
|
-NSString * const KMProAdvancedAddDevicesAllAccessPack12Months = @"com.pdfreaderpro.mac.advanced_add_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_devices_all_access_pack_12months
|
|
|
|
-NSString * const KMProAdvancedAdd2DevicesAllAccessPack12Months = @"com.pdfreaderpro.mac.advanced_add_2_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_2_devices_all_access_pack_12months
|
|
|
|
|
|
+NSString * const KMAIAllAccessPack1Month = @"com.pdfreaderpro.mac.ai_pack_1_month"; // 产品名称:ai_all_access_pack_1month(AI 订阅)
|
|
|
|
+NSString * const KMAIAllAccessPack12Month = @"com.pdfreaderpro.mac.ai_pack_12_month"; // 产品名称:ai_all_access_pack_12month(AI 订阅)
|
|
|
|
+NSString * const KMPDFToOfficePackPermanent = @"com.pdfreaderpro.mac.pdf_to_office_pack_permanent_license.001"; // 产品名称:pdf_to_office_pack_permanent(永久转档)
|
|
|
|
+NSString * const KM4DevicesAllAccessPack12Months = @"com.pdfreaderpro.mac.all_access_pack_advanced_annual.001"; // 产品名称:4_devices_all_access_pack_12months(全平台高级年订阅)
|
|
|
|
+NSString * const KMStandardAddDevicesAllAccessPack_12Months = @"com.pdfreaderpro.mac.standard_add_devices_all_access_pack_advanced_annual.001"; // 产品名称:standard_add_devices_all_access_pack_12months(多设备包订阅)
|
|
|
|
+NSString * const KMAdvancedAddDevicesAllAccessPack12Months = @"com.pdfreaderpro.mac.advanced_add_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_devices_all_access_pack_12months(多设备包订阅)
|
|
|
|
+NSString * const KMAdvancedAdd2DevicesAllAccessPack12Months = @"com.pdfreaderpro.mac.advanced_add_2_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_2_devices_all_access_pack_12months(多设备包订阅)
|
|
|
|
|
|
//NSString * const KMNewMonthLicenseProductIdentifier = @"com.pdftechnologies.pdfreader.mac.yearly.002.Test";
|
|
//NSString * const KMNewMonthLicenseProductIdentifier = @"com.pdftechnologies.pdfreader.mac.yearly.002.Test";
|
|
NSString * const KMAllLicenseProductIdentifier = @"com.pdfreaderpro.mac_free.member.all_access_pack_permanent_license.001";
|
|
NSString * const KMAllLicenseProductIdentifier = @"com.pdfreaderpro.mac_free.member.all_access_pack_permanent_license.001";
|
|
@@ -276,18 +280,19 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
<SKProductsRequestDelegate,SKPaymentTransactionObserver>
|
|
<SKProductsRequestDelegate,SKPaymentTransactionObserver>
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-@property (nonatomic,retain) IAPProduct *standardAnnualPlan_dmg; // 全平台标准版年订阅
|
|
|
|
-@property (nonatomic,retain) IAPProduct *advancedAnnualPlan_dmg; // 全平台高级版年订阅
|
|
|
|
-@property (nonatomic,retain) IAPProduct *permanent_dmg; // Mac&Windows双平台高级版永久
|
|
|
|
-@property (nonatomic,retain) IAPProduct *aiAnnualPlan_dmg; // AI 年订阅
|
|
|
|
-@property (nonatomic,retain) IAPProduct *aiMonthlyPlan_dmg; // AI 月订阅
|
|
|
|
-@property (nonatomic,retain) IAPProduct *addTwoDeviceAdvancedAnnual_dmg; // 多设备 年订阅 - 高级双平台升级高级全平台年订阅
|
|
|
|
|
|
+//@property (nonatomic,retain) IAPProduct *standardAnnualPlan_dmg; // 全平台标准版年订阅
|
|
|
|
+//@property (nonatomic,retain) IAPProduct *advancedAnnualPlan_dmg; // 全平台高级版年订阅
|
|
|
|
+//@property (nonatomic,retain) IAPProduct *permanent_dmg; // Mac&Windows双平台高级版永久
|
|
|
|
+//@property (nonatomic,retain) IAPProduct *aiAnnualPlan_dmg; // AI 年订阅
|
|
|
|
+//@property (nonatomic,retain) IAPProduct *aiMonthlyPlan_dmg; // AI 月订阅
|
|
|
|
+//@property (nonatomic,retain) IAPProduct *addTwoDeviceAdvancedAnnual_dmg; // 多设备 年订阅 - 高级双平台升级高级全平台年订阅
|
|
|
|
|
|
@property (nonatomic,retain) IAPProduct *advancedSixMonthPlan_lite; // 全平台高级版6个月订阅
|
|
@property (nonatomic,retain) IAPProduct *advancedSixMonthPlan_lite; // 全平台高级版6个月订阅
|
|
@property (nonatomic,retain) IAPProduct *advancedAnnualPlan_lite; // 全平台高级版年订阅
|
|
@property (nonatomic,retain) IAPProduct *advancedAnnualPlan_lite; // 全平台高级版年订阅
|
|
-@property (nonatomic,retain) IAPProduct *addThreeDeviceAdvancedAnnual; // 多设备 年订阅 - 高级双平台升级高级全平台年订阅
|
|
|
|
-
|
|
|
|
-@property (nonatomic,retain) IAPProduct *addDeviceAdvancedAnnual; // 多设备 年订阅 - 标准单平台升级高级全平台年订阅
|
|
|
|
|
|
+@property (nonatomic,retain) IAPProduct *aiMonthPlan_lite; // ai 1月订阅
|
|
|
|
+@property (nonatomic,retain) IAPProduct *aiYearPlan_lite; // ai 1年订阅
|
|
|
|
+@property (nonatomic,retain) IAPProduct *addDeveiceAllAccteePackYear_lite; // 多设备 高级版年订阅
|
|
|
|
+@property (nonatomic,retain) IAPProduct *add2DeveiceAllAccteePackYear_lite; // 多设备 高级版年订阅
|
|
|
|
|
|
@property (nonatomic,retain) IAPProduct *monthProduct;
|
|
@property (nonatomic,retain) IAPProduct *monthProduct;
|
|
@property (nonatomic,retain) IAPProduct *newlyMonthProduct;
|
|
@property (nonatomic,retain) IAPProduct *newlyMonthProduct;
|
|
@@ -339,33 +344,40 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
#if VERSION_FREE
|
|
#if VERSION_FREE
|
|
// 免费版
|
|
// 免费版
|
|
self.advancedSixMonthPlan_lite = [[[IAPProduct alloc] init] autorelease];
|
|
self.advancedSixMonthPlan_lite = [[[IAPProduct alloc] init] autorelease];
|
|
- self.advancedSixMonthPlan_lite.productIdentifier = KM4DevicesAllAccessPackNew6Months;
|
|
|
|
|
|
+ self.advancedSixMonthPlan_lite.productIdentifier = KM4DevicesAllAccessPackNew6Months_Free;
|
|
self.advancedSixMonthPlan_lite.priceNumber = @(49.99);
|
|
self.advancedSixMonthPlan_lite.priceNumber = @(49.99);
|
|
self.advancedSixMonthPlan_lite.offersPriceNumber = @(29.99);
|
|
self.advancedSixMonthPlan_lite.offersPriceNumber = @(29.99);
|
|
self.advancedSixMonthPlan_lite.isOffers = isOffers;
|
|
self.advancedSixMonthPlan_lite.isOffers = isOffers;
|
|
self.advancedSixMonthPlan_lite.mouthNumber = 6;
|
|
self.advancedSixMonthPlan_lite.mouthNumber = 6;
|
|
|
|
|
|
self.advancedAnnualPlan_lite = [[[IAPProduct alloc] init] autorelease];
|
|
self.advancedAnnualPlan_lite = [[[IAPProduct alloc] init] autorelease];
|
|
- self.advancedAnnualPlan_lite.productIdentifier = KM4DevicesAllAccessPack12months;
|
|
|
|
|
|
+ self.advancedAnnualPlan_lite.productIdentifier = KM4DevicesAllAccessPack12Months_Free;
|
|
self.advancedAnnualPlan_lite.priceNumber = @(99.99);
|
|
self.advancedAnnualPlan_lite.priceNumber = @(99.99);
|
|
self.advancedAnnualPlan_lite.offersPriceNumber = @(79.99);
|
|
self.advancedAnnualPlan_lite.offersPriceNumber = @(79.99);
|
|
self.advancedAnnualPlan_lite.isOffers = isOffers;
|
|
self.advancedAnnualPlan_lite.isOffers = isOffers;
|
|
self.advancedAnnualPlan_lite.mouthNumber = 12;
|
|
self.advancedAnnualPlan_lite.mouthNumber = 12;
|
|
|
|
+
|
|
|
|
+ self.aiYearPlan_lite = [[[IAPProduct alloc] init] autorelease];
|
|
|
|
+ self.aiYearPlan_lite.productIdentifier = KMAIAllAccessPack12Month_Free;
|
|
|
|
+ self.aiYearPlan_lite.priceNumber = @(125.99);
|
|
|
|
+ self.aiYearPlan_lite.offersPriceNumber = @(125.99);
|
|
|
|
+ self.aiYearPlan_lite.isOffers = isOffers;
|
|
|
|
+ self.aiYearPlan_lite.mouthNumber = 12;
|
|
|
|
|
|
self.monthProduct = [[[IAPProduct alloc] init] autorelease];
|
|
self.monthProduct = [[[IAPProduct alloc] init] autorelease];
|
|
- self.monthProduct.productIdentifier = KMMonthLicenseProductIdentifier;
|
|
|
|
|
|
+ self.monthProduct.productIdentifier = KMMonthLicenseProductIdentifier_Free;
|
|
self.monthProduct.priceNumber = @(29.99);
|
|
self.monthProduct.priceNumber = @(29.99);
|
|
self.monthProduct.mouthNumber = 1;
|
|
self.monthProduct.mouthNumber = 1;
|
|
|
|
|
|
self.newlyMonthProduct = [[[IAPProduct alloc] init] autorelease];
|
|
self.newlyMonthProduct = [[[IAPProduct alloc] init] autorelease];
|
|
- self.newlyMonthProduct.productIdentifier = KMNewMonthLicenseProductIdentifier;
|
|
|
|
|
|
+ self.newlyMonthProduct.productIdentifier = KMNewMonthLicenseProductIdentifier_Free;
|
|
self.newlyMonthProduct.priceNumber = @(39.99);
|
|
self.newlyMonthProduct.priceNumber = @(39.99);
|
|
self.newlyMonthProduct.offersPriceNumber = @(29.99);
|
|
self.newlyMonthProduct.offersPriceNumber = @(29.99);
|
|
self.newlyMonthProduct.isOffers = isOffers;
|
|
self.newlyMonthProduct.isOffers = isOffers;
|
|
self.newlyMonthProduct.mouthNumber = 6;
|
|
self.newlyMonthProduct.mouthNumber = 6;
|
|
|
|
|
|
self.yearProduct = [[[IAPProduct alloc] init] autorelease];
|
|
self.yearProduct = [[[IAPProduct alloc] init] autorelease];
|
|
- self.yearProduct.productIdentifier = KMYearLicenseProductIdentifier;
|
|
|
|
|
|
+ self.yearProduct.productIdentifier = KMYearLicenseProductIdentifier_Free;
|
|
self.yearProduct.priceNumber = @(59.99);
|
|
self.yearProduct.priceNumber = @(59.99);
|
|
self.yearProduct.offersPriceNumber = @(29.99);
|
|
self.yearProduct.offersPriceNumber = @(29.99);
|
|
self.yearProduct.isOffers = isOffers;
|
|
self.yearProduct.isOffers = isOffers;
|
|
@@ -387,9 +399,9 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
self.allAccessProduct.isSubscribed = [[[NSUserDefaults standardUserDefaults] objectForKey:@"allAccessProduct.isSubscribed"] boolValue];
|
|
self.allAccessProduct.isSubscribed = [[[NSUserDefaults standardUserDefaults] objectForKey:@"allAccessProduct.isSubscribed"] boolValue];
|
|
}
|
|
}
|
|
|
|
|
|
- self.productIdentifiers = @[KMMonthLicenseProductIdentifier,
|
|
|
|
- KMNewMonthLicenseProductIdentifier,
|
|
|
|
- KMYearLicenseProductIdentifier,
|
|
|
|
|
|
+ self.productIdentifiers = @[KMMonthLicenseProductIdentifier_Free,
|
|
|
|
+ KMNewMonthLicenseProductIdentifier_Free,
|
|
|
|
+ KMYearLicenseProductIdentifier_Free,
|
|
KMAllLicenseProductIdentifier,
|
|
KMAllLicenseProductIdentifier,
|
|
KMAILicenseProductIdentifier];
|
|
KMAILicenseProductIdentifier];
|
|
#else
|
|
#else
|
|
@@ -426,6 +438,7 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
#endif
|
|
#endif
|
|
[_advancedSixMonthPlan_lite release];
|
|
[_advancedSixMonthPlan_lite release];
|
|
[_advancedAnnualPlan_lite release];
|
|
[_advancedAnnualPlan_lite release];
|
|
|
|
+ [_aiYearPlan_lite release];
|
|
|
|
|
|
[_monthProduct release];
|
|
[_monthProduct release];
|
|
[_newlyMonthProduct release];
|
|
[_newlyMonthProduct release];
|
|
@@ -514,7 +527,6 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
|
|
|
|
NSString *discountId = @"all_access_pack_12months_202407260";
|
|
NSString *discountId = @"all_access_pack_12months_202407260";
|
|
NSString *sixDiscountId = @"all_access_pack_new_6months_202407260";
|
|
NSString *sixDiscountId = @"all_access_pack_new_6months_202407260";
|
|
-// SKProductDiscount *discount = iapProduct.product.discounts.firstObject;
|
|
|
|
SKProductDiscount *flagDiscount = nil;
|
|
SKProductDiscount *flagDiscount = nil;
|
|
for (SKProductDiscount *dis in iapProduct.product.discounts) {
|
|
for (SKProductDiscount *dis in iapProduct.product.discounts) {
|
|
if ([dis.identifier isEqualToString:discountId]) {
|
|
if ([dis.identifier isEqualToString:discountId]) {
|
|
@@ -543,15 +555,6 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
payment.paymentDiscount = paymentDiscount;
|
|
payment.paymentDiscount = paymentDiscount;
|
|
|
|
|
|
[[SKPaymentQueue defaultQueue] addPayment:payment];
|
|
[[SKPaymentQueue defaultQueue] addPayment:payment];
|
|
-
|
|
|
|
-// SKMutablePayment *payment = [SKMutablePayment paymentWithProduct:iapProduct.product];
|
|
|
|
-// NSUUID *uid = [[NSUUID alloc] initWithUUIDString:@"198b80fe-181f-53f4-9c4e-5d6e73f290eb"];
|
|
|
|
-// NSNumber *time = [NSNumber numberWithDouble:1721983323123];
|
|
|
|
-// SKPaymentDiscount *paymentDiscount = [[SKPaymentDiscount alloc] initWithIdentifier:flagDiscount.identifier keyIdentifier:@"7ZM85LHZYB" nonce:uid signature:@"MEUCIQCa3ZbKANYgJFsr71tCfPQeUyMXXMHKRFhzIDzxaJX8TAIgTN29r1bYCxwResW7gfos1DuWE9ni2MpcacOla+aUCTQ=" timestamp:time];
|
|
|
|
-// payment.applicationUsername = @"user_name";
|
|
|
|
-// payment.paymentDiscount = paymentDiscount;
|
|
|
|
-//
|
|
|
|
-// [[SKPaymentQueue defaultQueue] addPayment:payment];
|
|
|
|
} else {
|
|
} else {
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:KMIAPProductFailedNotification
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:KMIAPProductFailedNotification
|
|
object:iapProduct.productIdentifier];
|
|
object:iapProduct.productIdentifier];
|
|
@@ -713,33 +716,7 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
NSURL *url = [NSURL URLWithString:KMSandboxServer];
|
|
NSURL *url = [NSURL URLWithString:KMSandboxServer];
|
|
#else
|
|
#else
|
|
NSURL *url = [NSURL URLWithString:KMItunesServer];
|
|
NSURL *url = [NSURL URLWithString:KMItunesServer];
|
|
-#endif
|
|
|
|
-// NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
|
|
|
|
-// [request setHTTPMethod:@"POST"];
|
|
|
|
-// [request setHTTPBody:requestData];
|
|
|
|
-//
|
|
|
|
-// NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
|
|
|
|
-// NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
|
|
|
|
-// BOOL isSuccessful = NO;
|
|
|
|
-// if (!error) {
|
|
|
|
-// NSDictionary *jsonResponse = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
|
|
|
|
-// jsonResponse = [jsonResponse filterNullObject];
|
|
|
|
-// isSuccessful = [self fetchReceipt:jsonResponse];
|
|
|
|
-// if (isSuccessful) {
|
|
|
|
-// [[NSUserDefaults standardUserDefaults] setObject:jsonResponse forKey:KMStoreReceipt];
|
|
|
|
-// [[NSUserDefaults standardUserDefaults] synchronize];
|
|
|
|
-// } else {
|
|
|
|
-// error = [[[NSError alloc] init] autorelease];
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
-// if (handler) {
|
|
|
|
-// handler(error);
|
|
|
|
-// }
|
|
|
|
-// });
|
|
|
|
-// }];
|
|
|
|
-// [task resume];
|
|
|
|
-
|
|
|
|
|
|
+#endif
|
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];
|
|
ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];
|
|
request.defaultResponseEncoding = NSUTF8StringEncoding;
|
|
request.defaultResponseEncoding = NSUTF8StringEncoding;
|
|
@@ -844,6 +821,14 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
self.advancedAnnualPlan_lite.isTrialPeriod = YES;
|
|
self.advancedAnnualPlan_lite.isTrialPeriod = YES;
|
|
}
|
|
}
|
|
self.advancedAnnualPlan_lite.originalPurchased = YES;
|
|
self.advancedAnnualPlan_lite.originalPurchased = YES;
|
|
|
|
+ } else if ([product_id isEqualToString:self.aiYearPlan_lite.productIdentifier]) {
|
|
|
|
+ if (!self.aiYearPlan_lite.isSubscribed) {
|
|
|
|
+ self.aiYearPlan_lite.isSubscribed = isActive;
|
|
|
|
+ }
|
|
|
|
+ if ([receipt[@"is_trial_period"] boolValue]) {
|
|
|
|
+ self.aiYearPlan_lite.isTrialPeriod = YES;
|
|
|
|
+ }
|
|
|
|
+ self.aiYearPlan_lite.originalPurchased = YES;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -915,6 +900,14 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
self.advancedAnnualPlan_lite.isTrialPeriod = YES;
|
|
self.advancedAnnualPlan_lite.isTrialPeriod = YES;
|
|
}
|
|
}
|
|
self.advancedAnnualPlan_lite.originalPurchased = YES;
|
|
self.advancedAnnualPlan_lite.originalPurchased = YES;
|
|
|
|
+ } else if ([product_id isEqualToString:self.aiYearPlan_lite.productIdentifier]) {
|
|
|
|
+ if (!self.aiYearPlan_lite.isSubscribed) {
|
|
|
|
+ self.aiYearPlan_lite.isSubscribed = isActive;
|
|
|
|
+ }
|
|
|
|
+ if ([receipt[@"is_trial_period"] boolValue]) {
|
|
|
|
+ self.aiYearPlan_lite.isTrialPeriod = YES;
|
|
|
|
+ }
|
|
|
|
+ self.aiYearPlan_lite.originalPurchased = YES;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -936,6 +929,8 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
self.advancedSixMonthPlan_lite.autoRenewStatus = status;
|
|
self.advancedSixMonthPlan_lite.autoRenewStatus = status;
|
|
} else if([product_id isEqualToString:self.advancedAnnualPlan_lite.productIdentifier]) {
|
|
} else if([product_id isEqualToString:self.advancedAnnualPlan_lite.productIdentifier]) {
|
|
self.advancedAnnualPlan_lite.autoRenewStatus = status;
|
|
self.advancedAnnualPlan_lite.autoRenewStatus = status;
|
|
|
|
+ } else if([product_id isEqualToString:self.aiYearPlan_lite.productIdentifier]) {
|
|
|
|
+ self.aiYearPlan_lite.autoRenewStatus = status;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1096,6 +1091,12 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
object:nil];
|
|
object:nil];
|
|
}];
|
|
}];
|
|
self.advancedAnnualPlan_lite.isSubscribed = YES;
|
|
self.advancedAnnualPlan_lite.isSubscribed = YES;
|
|
|
|
+ } else if ([productIdentifier isEqualToString:self.aiYearPlan_lite.productIdentifier]) {
|
|
|
|
+ [self loadReceipt:^(NSError *error) {
|
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:KMIAPSubscriptionLoadedNotification
|
|
|
|
+ object:nil];
|
|
|
|
+ }];
|
|
|
|
+ self.aiYearPlan_lite.isSubscribed = YES;
|
|
}
|
|
}
|
|
if (!self.isPurchasing) {
|
|
if (!self.isPurchasing) {
|
|
return;
|
|
return;
|
|
@@ -1180,7 +1181,9 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
informative = NSLocalizedString(@"Restore successfully", nil);
|
|
informative = NSLocalizedString(@"Restore successfully", nil);
|
|
} else if (self.allAccessProduct.isSubscribed || self.advancedSixMonthPlan_lite.isSubscribed || self.advancedAnnualPlan_lite.isSubscribed) {
|
|
} else if (self.allAccessProduct.isSubscribed || self.advancedSixMonthPlan_lite.isSubscribed || self.advancedAnnualPlan_lite.isSubscribed) {
|
|
informative = NSLocalizedString(@"Restore successfully. You can start using the advanced tools, including PDF to Office, PDF Watermark, Page Editor, and more.", nil);
|
|
informative = NSLocalizedString(@"Restore successfully. You can start using the advanced tools, including PDF to Office, PDF Watermark, Page Editor, and more.", nil);
|
|
- } else if (self.monthProduct.originalPurchased ||
|
|
|
|
|
|
+ } else if (self.aiYearPlan_lite.isSubscribed) {
|
|
|
|
+ informative = NSLocalizedString(@"Restore successfully", nil);
|
|
|
|
+ }else if (self.monthProduct.originalPurchased ||
|
|
self.newlyMonthProduct.originalPurchased || self.yearProduct.originalPurchased) {
|
|
self.newlyMonthProduct.originalPurchased || self.yearProduct.originalPurchased) {
|
|
informative = [NSString stringWithFormat:@"\n%@\n\n%@\n\n%@\n\n",
|
|
informative = [NSString stringWithFormat:@"\n%@\n\n%@\n\n%@\n\n",
|
|
NSLocalizedString(@"Your subscription has expired, please repurchase", nil),
|
|
NSLocalizedString(@"Your subscription has expired, please repurchase", nil),
|
|
@@ -1314,9 +1317,9 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
|
|
self.proAIProduct.product = product;
|
|
self.proAIProduct.product = product;
|
|
} else if ([product.productIdentifier isEqualToString:self.advancedSixMonthPlan_lite.productIdentifier]) {
|
|
} else if ([product.productIdentifier isEqualToString:self.advancedSixMonthPlan_lite.productIdentifier]) {
|
|
self.advancedSixMonthPlan_lite.product = product;
|
|
self.advancedSixMonthPlan_lite.product = product;
|
|
- } else if ([product.productIdentifier isEqualToString:self.advancedAnnualPlan_lite.productIdentifier]) {
|
|
|
|
- self.advancedAnnualPlan_lite.product = product;
|
|
|
|
- }
|
|
|
|
|
|
+ } else if ([product.productIdentifier isEqualToString:self.aiYearPlan_lite.productIdentifier]) {
|
|
|
|
+ self.aiYearPlan_lite.product = product;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:KMIAPProductLoadedNotification
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:KMIAPProductLoadedNotification
|