Problem mit transactionreceipt deprecated in iOS 7 Warnung

Werde ich update meine App für iOS 7 und ich bin mit IAP , aber xcode 5 geben mir diese Fehlermeldung :

transactionreceipt ist veraltet : erste deprecated in iOS 7

hier ist mein code :

//saves a record of the transaction by storing the receipt to disk
    - (void)recordTransaction:(SKPaymentTransaction *)transaction
    {
        if ([transaction.payment.productIdentifier isEqualToString:kProductIdentifier])
        {
            //save the transaction receipt to disk
            [[NSUserDefaults standardUserDefaults] setValue:transaction.transactionReceipt forKey:@"proUpgradeTransactionReceipt"];
            [[NSUserDefaults standardUserDefaults] synchronize];
        }
    }

wie kann ich dieses Problem lösen ?

//EDITED :

Habe ich meine AndreyMan Antwort, aber nichts geschah, und der compiler hat mir APP:requestProductData ENDE Nachricht

- (void)requestProductData
{
       [NSThread sleepForTimeInterval:2];

    NSLog(@"IN-APP:requestProductData");
    SKProductsRequest *request= [[SKProductsRequest alloc]
                                 initWithProductIdentifiers: [NSSet setWithObject: @"com.compony.product"]];
    request.delegate = self;
    [request start];

    NSLog(@"IN-APP:requestProductData END");


}

und dann gibt mir diese Meldungen :

2013-10-08 14:26:21.400 Arta[1138:60b] Purchasing... 2013-10-08 14:26:28.380 Arta[1138:60b] Unknown Reason. 2013-10-08 14:26:28.383

Arta[1138:60b] Kauf faild...

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction *transaction in transactions)
    {
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchased:
                [self completeTransaction:transaction];
                NSLog(@"Purchase compelete...");
                break;
            case SKPaymentTransactionStateFailed:
                [self failedTransaction:transaction];
                NSLog(@"Purchase faild...");
                break;
            case SKPaymentTransactionStateRestored:
                [self restoreTransaction:transaction];
                NSLog(@"Restore compelete...");
                break;
            case SKPaymentTransactionStatePurchasing:
                NSLog(@"Purchasing...");
                break;
            default:
                break;
        }
    }
}




- (void)failedTransaction:(SKPaymentTransaction *)transaction
{
    if (transaction.error.code != SKErrorPaymentCancelled)
    {
        //error!
        [self finishTransaction:transaction wasSuccessful:NO];
        if (transaction.error.code == SKErrorClientInvalid) {
        }
        else if (transaction.error.code == SKErrorPaymentInvalid) {

        }
        else if (transaction.error.code == SKErrorPaymentNotAllowed) {
        }
        else if (transaction.error.code == SKErrorPaymentCancelled) {
            //[self showAlert:@"In-App Purchase" withMessage:@"This device is not allowed to make the payment."];
            NSLog(@"User Cancellation.");
        }
        else {
            //SKErrorUnknown
            NSLog(@"Unknown Reason.");
        }
    }
    else  {
        //this is fine, the user just cancelled, so don’t notify
        [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
    }
}
  • Siehe die Eingang Validierung Programming Guide. Erhalt der Validierung unterscheidet sich in iOS 7.
  • sorry, ich bekomme es nicht !! würde mir bitte ein Beispiel oder so etwas ?
  • Gehen Sie auf die Apple-developer-Foren und suchen Sie nach Erhalt Validierung. Es gibt viele Diskussionen und code-Referenzen.
InformationsquelleAutor Mc.Lover | 2013-09-25
Schreibe einen Kommentar