How to test appStoreReceiptURL on OSX

I developed one app (free app) and uploaded it to the apple store, right now I want to know if the app is installed from the app store or local pkg file. Therefore, I will use the code as shown below:

    NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
    NSData *receiptData = [NSData dataWithContentsOfURL:receiptURL];
    if (!receiptData) {
        [NSException raise:@"MacAppStore Receipt Validation Error" format:@"Failed to fetch the MacAppStore receipt.", nil];
    }

      

When receiptData is nil, then I can know the app is installed from the local pkg file, right? And I also want to test this code without submitting this new change to the Apple Store, is there anyone who can help? Thanks to

+3
objective-c macos


source to share


No one has answered this question yet

Check out similar questions:

1676
How do I install pip on macOS or OS X?
1665
How can I get the UITextField to move upward when there is a keyboard - when starting editing?
1276
How can I disable ARC for one file in a project?
1264
How to check an active internet connection on iOS or macOS?
1138
How do I remove .DS_Store files from a Git repository?
31
How to upload iOS app to app store via command line
4
Checking App Status AppReceiptStoreURL 21002
1
Can pure device check authenticate in real time with iOS6?
0
iOS in-appReceipt purchase transaction versus appStoreReceiptURL
0
Problem buying an app in a Mac app



All Articles
Loading...
X
Show
Funny
Dev
Pics