2

有没有人成功使用 Beeblex 验证应用内购买?我有一个应用程序已经存在于应用程序商店中,并且启用了应用程序内购买并且可以正常工作。鉴于最近有关应用内购买的黑客新闻,我正在尝试更新它以使用 Beeblex 来验证购买。问题是 Beeblex 总是返回一个结果,说苹果声称购买无效。我希望这里有人成功使用 Beeblex 并可以发布一个工作示例。我按照他们的建议让购买完全通过,然后进行验证。我基本上只是从他们的网站上剪切并粘贴了他们的代码,所以不确定我能做些什么不同的事情。

- (void) validatePurchaseOrRestore

{

//The transaction has been reported as complete for a new purchase of the upgrade.  I now make use of Beeblex
//to verify the receipt to ensure the purchase is legit.
if (![BBXIAPTransaction canValidateTransactions])
{
    transactionResult = 4;
    return; // There is no connectivity to reach the server.
    // You should try the validation at a later date.
}

BBXIAPTransaction *bbxTransaction = [[BBXIAPTransaction alloc] initWithTransaction:transactionCopy];
bbxTransaction.useSandbox;

[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.
             transactionResult = 1;

         }
         else
         {
             // The transaction has been successfully validated
             // and is unique.

             NSLog(@"Transaction data: %@", bbxTransaction.validatedTransactionData);
             transactionResult = 0;
         }
     }
     else
     {
         // Check whether this is a validation error, or if something
         // went wrong with Beeblex.

         if (bbxTransaction.hasServerError)
         {                 
             // The error was not caused by a problem with the data, but is
             // most likely due to some transient networking issues.
             transactionResult = 4;
         }
         else
         {                 
             // The transaction supplied to the validation service was not valid according to Apple.
             transactionResult = 3;
             purchaseDidFail = TRUE;
         }    
     }
 }];

}

4

0 回答 0