Using the receipt validator with the cordova purchase plugin is as simple as adding a single line in your code at plugin initialization.
Note: Replace <PUBLIC_KEY> and <APP_NAME> with values from your account.
Your account on billing.fovea.cc needs to be configured correctly for the platforms you intend to use (shared key on iOS, license key on Android, etc).
Receipt validation is being called when you do
p.verify(). Some demo code omit this line, so make sure that
p.verify() is called from the
approved event, then
p.finish() called from the
.approved(p => p.verify())
.verified(p => p.finish());
You might have to edit your existing handlers for
approved events to make sure it doesn't call
Depending on how your app is configured, security policy may prevent you to make requests to the validation service (DOM Exception 18 / Error 0). To prevent this, it make sure https://reeceipt-validator.fovea.cc is listed in your HTML file’s meta "Content-Security-Policy", in the "default-src" list.
Here’s an example of what that looks like:
content="default-src 'self' https://reeceipt-validator.fovea.cc 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">