TPInAppReceipt
A lightweight library for reading and validating Apple In App Purchase Receipt locally.
Features
- [x] Extract all In-App Receipt Attributes
- [x] Hash Verification
- [x] Verify Bundle Version and Identifiers
- [x] Signature Verification
Installation
CocoaPods
To integrate TPInAppReceipt into your project using CocoaPods, specify it in your Podfile
:
Then, run the following command:
In any swift file you'd like to use TPInAppReceipt, import the framework with import TPInAppReceipt
.
Swift Package Manager
To integrate using Apple's Swift package manager, add the following as a dependency to your Package.swift
:
Then, specify "TPInAppReceipt"
as a dependency of the Target in which you wish to use TPInAppReceipt.
Lastly, run the following command:
Carthage
Make the following entry in your Cartfile:
github "tikhop/TPInAppReceipt"
Then run carthage update
.
If this is your first time using Carthage in the project, you'll need to go through some additional steps as explained over at Carthage.
Requirements
- iOS 9.0+ / OSX 10.11+
- Swift 5.3+
Usage
Working With a Receipt
InAppReceipt
is an object to incapsulate all necessary getters from a receipt payload and provides a comprehensive API for reading and validating in app receipt and related purchases.
Initializing Receipt
Refreshing/Requesting Receipt
Use this method to request a new receipt if the receipt is invalid or missing.