1

我正在越狱的 iphone 上测试我的应用程序的应用程序内购买,以便用户无法使用 iAP Crazy、iAP 破解器等破解其 iap。问题是应用程序未处于调试模式时崩溃(通过 xcode 调试时工作正常(使用 iapcrazy , 安装了 iAP 破解器),也可以正常工作(调试或不调试,当 iAPCrzy 和 iap 破解器未安装时)

希望可以有人帮帮我。

我正在使用 RMStore https://github.com/robotmedia/RMStore进行购买

这是我的代码

 repeatValidator = 0;

    [[RMStore defaultStore] addPayment:item_id success:^(SKPaymentTransaction *transaction) {

        const BOOL verified = [self verifyReceiptWithCustomLogic];
        if (verified)
        {
            [HUD hide:YES];
            [db pushToLog:1 withPuchaseType:[NSString stringWithFormat:@"PAYMENT SUCCESSFULLY RECEIVED ON %@",item_id]];

            if (repeatValidator == 0){
                [self goAdd];
                repeatValidator = 1;
            }
            [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
            [HUD hide:YES];
            NSLog(@"Product purchased verified");
        }
        else
        { // Apple recommends to refresh the receipt if validation fails on iOS
            [[RMStore defaultStore] refreshReceiptOnSuccess:^{
                const BOOL verified = [self verifyReceiptWithCustomLogic];
                if (verified)
                {
                   [HUD hide:YES];
                    [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                    NSLog(@"Product purchased verified (2)");
                    if (repeatValidator == 0){
                        [self goAdd];
                        repeatValidator = 1;
                    }
                }
                else
                {
                    UIAlertView *myAlert3 = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Transaction cannot proceed. \nServer cannot verify payment" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                    [myAlert3 show];

                   // [self failedTransaction:transaction];
                    [db pushToLog:1 withPuchaseType:[NSString stringWithFormat:@"MALICIOUS TRANSACTION ON %@",item_id]];
                    [HUD hide:YES];
                    [self enableButtons];
                    NSLog(@"V FAILED REF (1)");


                }
            } failure:^(NSError *error) {
                [db pushToLog:1 withPuchaseType:[NSString stringWithFormat:@"MALICIOUS TRANSACTION OR BAD COONECTION AT %@",item_id]];
                NSLog(@"V FAILED REF (2)");
                [self enableButtons];
                [HUD hide:YES];
            }];
        }

    } failure:^(SKPaymentTransaction *transaction, NSError *error) {
        //[self failedTransaction:transaction];
        [db pushToLog:1 withPuchaseType:[NSString stringWithFormat:@"TRANSACTION DISMISSED ON %@",item_id]];
        [HUD hide:YES];
        [self enableButtons];
        NSLog(@"V FAILED REF (3)");
    }];
4

0 回答 0