Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>&lt;3 blocks</p> <pre><code>- (void)verifyTransaction:(SKPaymentTransaction *)transaction completionHandler:(void (^)(BOOL flag))completionHandler { if (![BBXIAPTransaction canValidateTransactions]) { completionHandler(YES); // There is no connectivity to reach the server } BBXIAPTransaction *bbxTransaction = [[BBXIAPTransaction alloc] initWithTransaction:transaction]; bbxTransaction.useSandbox = YES; [bbxTransaction validateWithCompletionBlock:^(NSError *error) { if (bbxTransaction.transactionVerified) { if (bbxTransaction.transactionIsDuplicate) { // The transaction is valid, but duplicate - it has already been sent to Beeblex in the past. NSLog(@"Transaction is a duplicate!"); [FlurryAnalytics logEvent:@"Transaction duplicate!"]; completionHandler(NO); } else { // The transaction has been successfully validated and is unique NSLog(@"Transaction valid data:%@",bbxTransaction.validatedTransactionData); [FlurryAnalytics logEvent:@"Transaction verified"]; completionHandler(YES); } } else { // Check whether this is a validation error, or if something went wrong with Beeblex if (bbxTransaction.hasConfigurationError || bbxTransaction.hasServerError || bbxTransaction.hasClientError) { // The error was not caused by a problem with the data, but is most likely due to some transient networking issues NSLog(@"Transaction error caused by network, not data"); [FlurryAnalytics logEvent:@"Transaction network error"]; completionHandler(YES); } else { // The transaction supplied to the validation service was not valid according to Apple NSLog(@"Transaction not valid according to Apple"); [FlurryAnalytics logEvent:@"Transaction invalid!!"]; completionHandler(NO); } } }]; } </code></pre> <p>Then use</p> <pre><code>[instance verifyTransaction:transaction completionHandler:^(BOOL flag) { if (flag) { // YOUR CODE HERE } }]; </code></pre> <p>instead of</p> <pre><code>if ([instance verifyTransaction:transaction]) { // YOUR CODE HERE } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload