baxi 5 dienas atpakaļ
vecāks
revīzija
7895d86034
1 mainītis faili ar 6 papildinājumiem un 6 dzēšanām
  1. 6 6
      native/engine/ios/service/IAPWrapper.mm

+ 6 - 6
native/engine/ios/service/IAPWrapper.mm

@@ -9,7 +9,7 @@
 @interface IAPWrapper () <SKProductsRequestDelegate, SKPaymentTransactionObserver>
 @property(nonatomic, strong) NSMutableDictionary<NSString *, SKProduct *> *products;
 @property(nonatomic, strong) SKProductsRequest *productsRequest;
-@property(nonatomic, strong) NSDictionary *initRequest;
+@property(nonatomic, strong) NSDictionary *catalogRequest;
 @property(nonatomic, strong) NSDictionary *purchaseRequest;
 @property(nonatomic, strong) NSDictionary *restoreRequest;
 @property(nonatomic, strong) NSMutableArray *restored;
@@ -79,7 +79,7 @@
         for (id value in ids) if (![value isKindOfClass:NSString.class] || ![value length]) {
             [self reply:r data:nil error:@"商品 ID 必须为非空字符串。"]; return;
         }
-        self.initRequest = r;
+        self.catalogRequest = r;
         self.productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithArray:ids]];
         self.productsRequest.delegate = self;
         [self.productsRequest start];
@@ -127,15 +127,15 @@
                 @"description": product.localizedDescription ?: @"", @"price": product.price.stringValue,
                 @"localizedPrice": [formatter stringFromNumber:product.price] ?: @"", @"currencyCode": formatter.currencyCode ?: @""}];
         }
-        [self reply:self.initRequest data:@{@"products": items, @"invalidProductIds": response.invalidProductIdentifiers} error:nil];
-        self.initRequest = nil; self.productsRequest = nil;
+        [self reply:self.catalogRequest data:@{@"products": items, @"invalidProductIds": response.invalidProductIdentifiers} error:nil];
+        self.catalogRequest = nil; self.productsRequest = nil;
     });
 }
 - (void)request:(SKRequest *)request didFailWithError:(NSError *)error {
     dispatch_async(dispatch_get_main_queue(), ^{
         if (request != self.productsRequest) return;
-        [self reply:self.initRequest data:nil error:error.localizedDescription];
-        self.initRequest = nil; self.productsRequest = nil;
+        [self reply:self.catalogRequest data:nil error:error.localizedDescription];
+        self.catalogRequest = nil; self.productsRequest = nil;
     });
 }
 - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray<SKPaymentTransaction *> *)transactions {