0

My macOS app was rejected for not checking for the existence of a purchase receipt, "which can prevent In-App Purchases from being correctly processed."

They recommend implementing receipt validation to resolve this issue, going on to say that at a minimum, the app will need to check for the existence of an App Store receipt and exit at launch with a status of 173 if it does not exist.

I've followed the documentation link provided - but, other than getting a headache, I'm still none the wiser.

I tried doing the bare minimum (checking that the receipt exists, and exiting with 173 if it doesn't), but that didn't work - my app was still rejected. I suspect that this is because I'm only checking to see if a receipt is present for the App itself - I'm not validating purchases that have been made (all consumables).

The next thing I tried was experimenting with the work of others - standing on the shoulders of giants - https://github.com/roddi/ValidateStoreReceipt

This doesn't work either - because openssl is deprecated, and even installing it with brew and symbolically linking to /usr/local/include/openssl didn't help at all.

I'm including:

#import <IOKit/IOKitLib.h>
#import <Foundation/Foundation.h>
#import <Security/Security.h>
#include <openssl/pkcs7.h>
#include <openssl/objects.h>
#include <openssl/sha.h>
#include <openssl/x509.h>
#include <openssl/err.h>

But I'm still getting the error "'openssl/pkcs7.h' file not found"

Does anyone know how to do this using Xcode 8.2 on Sierra?

headbanger
  • 1,038
  • 1
  • 11
  • 32
  • Also see [Installing OpenSSL library for Xcode](http://stackoverflow.com/q/22692564), [How to include OpenSSL on an iOS project in a way that works](http://stackoverflow.com/q/23955003), [how to add openssl to a swift project](http://stackoverflow.com/q/31380713), [Where I can find openssl iOS 7 libcrypto.a and libssl.a static library](http://stackoverflow.com/q/19812997), [openssl libs in Xcode 4](http://stackoverflow.com/q/9262938), [OpenSSL on iPhone](http://stackoverflow.com/q/1736036), [Is anyone able to perform Receipt validation?](http://stackoverflow.com/q/5799431), etc. – jww Dec 16 '16 at 02:50
  • Yes. I have looked at most of those, but they're so out of date as to be completely irrelevant (hence my question). The one I hadn't seen was this one - http://stackoverflow.com/questions/23955003/how-to-include-openssl-on-an-ios-project-in-a-way-that-works - but it relies on the use of CocoaPods (which is new to me, and I had been trying to avoid) – headbanger Dec 16 '16 at 10:39

0 Answers0