{"id":25703579,"url":"https://github.com/tikhop/tpinappreceipt","last_synced_at":"2026-02-04T20:09:35.518Z","repository":{"id":45334692,"uuid":"69627072","full_name":"tikhop/TPInAppReceipt","owner":"tikhop","description":"Reading and Validating In App Purchase Receipt Locally.","archived":false,"fork":false,"pushed_at":"2024-10-24T18:33:21.000Z","size":31419,"stargazers_count":661,"open_issues_count":8,"forks_count":94,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-01T10:06:27.532Z","etag":null,"topics":["asn1","catalyst","cocoapods","in-app-purchase","in-app-receipt","ios","macos","osx","payment","pkcs7","purchase","receipt","receipt-validation","receipt-verification","storekit","swift","swift5","verify"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tikhop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-30T02:40:24.000Z","updated_at":"2025-03-19T23:45:25.000Z","dependencies_parsed_at":"2022-08-19T05:01:58.312Z","dependency_job_id":"e44f2a3e-2fb4-4c24-b348-77f18c040a5a","html_url":"https://github.com/tikhop/TPInAppReceipt","commit_stats":{"total_commits":319,"total_committers":17,"mean_commits":"18.764705882352942","dds":"0.26645768025078365","last_synced_commit":"e135055eaeba5a52874b7f9b290f42890cbe981f"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikhop%2FTPInAppReceipt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikhop%2FTPInAppReceipt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikhop%2FTPInAppReceipt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikhop%2FTPInAppReceipt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tikhop","download_url":"https://codeload.github.com/tikhop/TPInAppReceipt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247829490,"owners_count":21002995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asn1","catalyst","cocoapods","in-app-purchase","in-app-receipt","ios","macos","osx","payment","pkcs7","purchase","receipt","receipt-validation","receipt-verification","storekit","swift","swift5","verify"],"created_at":"2025-02-25T05:32:31.424Z","updated_at":"2026-02-04T20:09:35.511Z","avatar_url":"https://github.com/tikhop.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg height=\"160\" src=\"https://github.com/tikhop/TPInAppReceipt/blob/master/www/logo.png\" /\u003e\n\u003c/p\u003e\n\n# TPInAppReceipt\n\n[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![Platform](https://img.shields.io/cocoapods/p/TPInAppReceipt.svg?style=flat)]()\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/tikhop/TPInAppReceipt/master/LICENSE)\n\nTPInAppReceipt is a lightweight, pure-Swift library for reading and validating Apple In App Purchase Receipt locally.\n\n## Installation\n\n### Requirements\n\n- Swift 6.0+ / Xcode 16+\n- macOS 10.15+ / iOS 13+ / tvOS 13+ / watchOS 6.2+ / visionOS 1+\n\n### Swift Package Manager\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/tikhop/TPInAppReceipt.git\", from: \"4.0.1\")\n]\n```\n\n```swift\n.target(\n    name: \"YourTarget\",\n    dependencies: [\"TPInAppReceipt\"]\n)\n```\n\n## Usage\n\n### Decoding and Reading\n\n```swift\nimport TPInAppReceipt\n\n// Local receipt\nlet receipt = try await AppReceipt.local\n\n// From raw data\nlet receipt = try AppReceipt.receipt(from: data)\n```\n\nAccess receipt fields, query purchases, check subscriptions and introductory offer eligibility. See [Working with Receipt](Sources/Docs.docc/Working%20with%20Receipt.md) for details.\n\n### Validating\n\nDefault validation: certificate chain + signature + hash + metadata.\n\n```swift\nlet result = await receipt.validate()\n\nswitch result {\ncase .valid:\n    break\ncase .invalid(let error):\n    print(error)\n}\n```\n\nSupports custom validators via `@VerifierBuilder`. See [Validating Receipt](Sources/Docs.docc/Validating%20Receipt.md) for details.\n\n### Blocking API\n\nFor contexts where async is not available. See [Blocking Mode](Sources/Docs.docc/Blocking%20Mode.md).\n\n```swift\n@_spi(Blocking) import TPInAppReceipt\n\nlet receipt = try AppReceipt.local_blocking\nlet result = receipt.validate_blocking()\n```\n\n## Migrating from v3\n\nSee [TPInAppReceipt 4.0 Migration Guide](Sources/Docs.docc/TPInAppReceipt%204.0%20Migration%20Guide.md).\n\n## Essential Reading\n\n* [Apple - About Receipt Validation](https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Introduction.html)\n* [Apple - Receipt Validation Programming Guide](https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1)\n* [Apple - Validating Receipts Locally](https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateLocally.html)\n* [fluffy.es - Tutorial: Read and validate in-app purchase receipt locally using TPInAppReceipt](https://fluffy.es/in-app-purchase-receipt-local/)\n* [Faisal Bin Ahmed - All the wrong ways to persist in-app purchase status in your macOS app](https://medium.com/@Faisalbin/all-the-wrong-ways-to-persist-in-app-purchase-status-in-your-macos-app-ce6eb9bcb0c3)\n* [objc.io - Receipt Validation](https://www.objc.io/issues/17-security/receipt-validation/)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikhop%2Ftpinappreceipt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftikhop%2Ftpinappreceipt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikhop%2Ftpinappreceipt/lists"}