Skip to content

008v/QWReceiptValidator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QWReceiptValidator

Validate In-App Purchase Receipt Locally

1. Setup OpenSSL Library

  • Build your OpenSSL static library file
  • Import .h and .a files into your project
  • Set Header Search Paths and User Header Search Paths
  • Add .a files into Linked Frameworks and Libraries

2. Copy QWReceiptValidator directory to your project

3. Validate Receipt

  • Note: bundle id and version must be hardcoded.
let validator = QWReceiptValidator.sharedInstance()
        validator.validateReceipt(withBundleIdentifier: "your.Bundle.Id", bundleVersion: "1", refresh: true, success: { (receipt) in
            // Handle Success
            // TODO: Parse the in-apps data and deliver content
            /*
            for iap in receipt.in_app {
                if iap.cancellation_date == nil &&
                iap.expires_date != nil &&
                Date().compare(iap.original_purchase_date) == .orderedDescending &&
                Date().compare(iap.expires_date!) == .orderedAscending {
                // ...
            }
            */
        }) { (error) in
            // Handle Failure
        }

About

Validate In-App Purchase Receipt Locally

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published