iOS 7 Local (on device) Receipt Validation and In-App Purchases Check

前端 未结 5 697
粉色の甜心
粉色の甜心 2021-02-01 05:38

I have implemented receipt validation locally on the device using OpenSSL and the asn1c compiler with help from Apple\'s Receipt Validation Programming Guide. My app only suppor

5条回答
  •  逝去的感伤
    2021-02-01 06:34

    Dialog for enter user's psw is shown if the receipt is invalid or does not exist.

    So RATHER then ask for psw at the beginning if receipt does not exist (for user is confusing bcs he just launch the app and it asks for no reason) PROVIDE Restore btn which you have to provide ANYWAY and w8 till you get receipt which you can reasonably varify.

    So put your refresh code into if statement:

    if([[NSFileManager defaultManager] fileExistsAtPath:[[[NSBundle mainBundle] appStoreReceiptURL] path]] == YES) {
    
            self.receiptRefreshRequest = [[SKReceiptRefreshRequest alloc] initWithReceiptProperties:nil];
            self.receiptRefreshRequest.delegate = self;
            [self.receiptRefreshRequest start];
    }
    

提交回复
热议问题