├── ios ├── metadata.json ├── Cartfile ├── Cartfile.resolved ├── .swiftlint.yml ├── platform │ └── SwiftyStoreKit.xcframework │ │ ├── macos-arm64_x86_64 │ │ ├── SwiftyStoreKit.framework │ │ │ ├── Versions │ │ │ │ ├── Current │ │ │ │ └── A │ │ │ │ │ ├── Modules │ │ │ │ │ ├── module.modulemap │ │ │ │ │ └── SwiftyStoreKit.swiftmodule │ │ │ │ │ │ ├── arm64-apple-macos.abi.json │ │ │ │ │ │ ├── x86_64-apple-macos.abi.json │ │ │ │ │ │ ├── arm64-apple-macos.swiftdoc │ │ │ │ │ │ ├── x86_64-apple-macos.swiftdoc │ │ │ │ │ │ ├── arm64-apple-macos.swiftmodule │ │ │ │ │ │ └── x86_64-apple-macos.swiftmodule │ │ │ │ │ ├── SwiftyStoreKit │ │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ │ └── Headers │ │ │ │ │ └── SwiftyStoreKit-Swift.h │ │ │ ├── Headers │ │ │ ├── Modules │ │ │ ├── Resources │ │ │ └── SwiftyStoreKit │ │ └── dSYMs │ │ │ └── SwiftyStoreKit.framework.dSYM │ │ │ └── Contents │ │ │ ├── Resources │ │ │ └── DWARF │ │ │ │ └── SwiftyStoreKit │ │ │ └── Info.plist │ │ ├── ios-arm64 │ │ ├── SwiftyStoreKit.framework │ │ │ ├── Modules │ │ │ │ ├── module.modulemap │ │ │ │ └── SwiftyStoreKit.swiftmodule │ │ │ │ │ ├── arm64-apple-ios.abi.json │ │ │ │ │ ├── arm64-apple-ios.swiftdoc │ │ │ │ │ └── arm64-apple-ios.swiftmodule │ │ │ ├── Info.plist │ │ │ ├── SwiftyStoreKit │ │ │ └── Headers │ │ │ │ └── SwiftyStoreKit-Swift.h │ │ └── dSYMs │ │ │ └── SwiftyStoreKit.framework.dSYM │ │ │ └── Contents │ │ │ ├── Resources │ │ │ └── DWARF │ │ │ │ └── SwiftyStoreKit │ │ │ └── Info.plist │ │ ├── ios-arm64_x86_64-simulator │ │ ├── SwiftyStoreKit.framework │ │ │ ├── Modules │ │ │ │ ├── module.modulemap │ │ │ │ └── SwiftyStoreKit.swiftmodule │ │ │ │ │ ├── arm64-apple-ios-simulator.abi.json │ │ │ │ │ ├── x86_64-apple-ios-simulator.abi.json │ │ │ │ │ ├── arm64-apple-ios-simulator.swiftdoc │ │ │ │ │ ├── x86_64-apple-ios-simulator.swiftdoc │ │ │ │ │ ├── arm64-apple-ios-simulator.swiftmodule │ │ │ │ │ ├── x86_64-apple-ios-simulator.swiftmodule │ │ │ │ │ └── Project │ │ │ │ │ ├── arm64-apple-ios-simulator.swiftsourceinfo │ │ │ │ │ └── x86_64-apple-ios-simulator.swiftsourceinfo │ │ │ ├── Info.plist │ │ │ ├── SwiftyStoreKit │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ └── dSYMs │ │ │ └── SwiftyStoreKit.framework.dSYM │ │ │ └── Contents │ │ │ ├── Resources │ │ │ └── DWARF │ │ │ │ └── SwiftyStoreKit │ │ │ └── Info.plist │ │ ├── watchos-arm64_x86_64-simulator │ │ ├── SwiftyStoreKit.framework │ │ │ ├── Modules │ │ │ │ ├── module.modulemap │ │ │ │ └── SwiftyStoreKit.swiftmodule │ │ │ │ │ ├── arm64-apple-watchos-simulator.abi.json │ │ │ │ │ ├── x86_64-apple-watchos-simulator.abi.json │ │ │ │ │ ├── arm64-apple-watchos-simulator.swiftdoc │ │ │ │ │ ├── arm64-apple-watchos-simulator.swiftmodule │ │ │ │ │ ├── x86_64-apple-watchos-simulator.swiftdoc │ │ │ │ │ ├── x86_64-apple-watchos-simulator.swiftmodule │ │ │ │ │ └── Project │ │ │ │ │ ├── arm64-apple-watchos-simulator.swiftsourceinfo │ │ │ │ │ └── x86_64-apple-watchos-simulator.swiftsourceinfo │ │ │ ├── Info.plist │ │ │ ├── SwiftyStoreKit │ │ │ ├── _CodeSignature │ │ │ │ └── CodeResources │ │ │ └── Headers │ │ │ │ └── SwiftyStoreKit-Swift.h │ │ └── dSYMs │ │ │ └── SwiftyStoreKit.framework.dSYM │ │ │ └── Contents │ │ │ ├── Resources │ │ │ └── DWARF │ │ │ │ └── SwiftyStoreKit │ │ │ └── Info.plist │ │ └── Info.plist ├── TiIap_Prefix.pch ├── Classes │ ├── TiIapModuleAssets.h │ ├── TiIap.h │ ├── TiIapModuleAssets.m │ ├── TiIapProductProxy.swift │ └── TiIapModule.swift ├── timodule.xml ├── titanium.xcconfig ├── manifest ├── Info.plist ├── module.xcconfig ├── hooks │ └── ti.swiftsupport.js └── titanium-in-app-purchase.xcodeproj │ └── project.pbxproj ├── android ├── .settings │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.apt.core.prefs │ └── org.eclipse.buildship.core.prefs ├── timodule.xml ├── platform │ └── README.md ├── manifest ├── build.gradle ├── .classpath ├── .clang-format ├── .project ├── src │ └── ti │ │ └── iap │ │ ├── handlers │ │ ├── BillingConnectionHandler.kt │ │ ├── PurchaseHandler.kt │ │ └── ProductsHandler.kt │ │ ├── models │ │ ├── SkuModel.kt │ │ └── PurchaseModel.kt │ │ ├── IAPConstants.kt │ │ ├── helper │ │ └── QueryHandler.kt │ │ └── TitaniumInAppPurchaseModule.kt ├── build.xml ├── java-sources.txt └── README.md ├── example ├── app.js └── iap-manager.js ├── README.md └── LICENSE /ios/metadata.json: -------------------------------------------------------------------------------- 1 | {"exports":[]} -------------------------------------------------------------------------------- /ios/Cartfile: -------------------------------------------------------------------------------- 1 | github "bizz84/SwiftyStoreKit" 2 | -------------------------------------------------------------------------------- /ios/Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "bizz84/SwiftyStoreKit" "0.16.4" 2 | -------------------------------------------------------------------------------- /ios/.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - identifier_name 3 | - cyclomatic_complexity -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /ios/TiIap_Prefix.pch: -------------------------------------------------------------------------------- 1 | 2 | #ifdef __OBJC__ 3 | #import 4 | #endif 5 | 6 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/SwiftyStoreKit: -------------------------------------------------------------------------------- 1 | Versions/Current/SwiftyStoreKit -------------------------------------------------------------------------------- /android/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Thu Sep 02 15:18:34 CDT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.processAnnotations=enabled 4 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyStoreKit { 2 | header "SwiftyStoreKit-Swift.h" 3 | requires objc 4 | } 5 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyStoreKit { 2 | header "SwiftyStoreKit-Swift.h" 3 | requires objc 4 | } 5 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyStoreKit { 2 | header "SwiftyStoreKit-Swift.h" 3 | requires objc 4 | } 5 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyStoreKit { 2 | header "SwiftyStoreKit-Swift.h" 3 | requires objc 4 | } 5 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/Info.plist -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/SwiftyStoreKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/SwiftyStoreKit -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Info.plist -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/SwiftyStoreKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/SwiftyStoreKit -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Info.plist -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/SwiftyStoreKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/SwiftyStoreKit -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/SwiftyStoreKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/SwiftyStoreKit -------------------------------------------------------------------------------- /ios/Classes/TiIapModuleAssets.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a generated file. Do not edit or your changes will be lost 3 | */ 4 | 5 | @interface TiIapModuleAssets : NSObject { 6 | 7 | } 8 | 9 | - (NSData *)moduleAsset; 10 | - (NSData *)resolveModuleAsset:(NSString*)path; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios.abi.json: -------------------------------------------------------------------------------- 1 | { 2 | "ABIRoot": { 3 | "kind": "Root", 4 | "name": "TopLevel", 5 | "printedName": "TopLevel", 6 | "json_format_version": 8 7 | }, 8 | "ConstValues": [] 9 | } -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Resources/DWARF/SwiftyStoreKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Resources/DWARF/SwiftyStoreKit -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios.swiftdoc -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Resources/DWARF/SwiftyStoreKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Resources/DWARF/SwiftyStoreKit -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios.swiftmodule -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-macos.abi.json: -------------------------------------------------------------------------------- 1 | { 2 | "ABIRoot": { 3 | "kind": "Root", 4 | "name": "TopLevel", 5 | "printedName": "TopLevel", 6 | "json_format_version": 8 7 | }, 8 | "ConstValues": [] 9 | } -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-macos.abi.json: -------------------------------------------------------------------------------- 1 | { 2 | "ABIRoot": { 3 | "kind": "Root", 4 | "name": "TopLevel", 5 | "printedName": "TopLevel", 6 | "json_format_version": 8 7 | }, 8 | "ConstValues": [] 9 | } -------------------------------------------------------------------------------- /android/.settings/org.eclipse.jdt.apt.core.prefs: -------------------------------------------------------------------------------- 1 | #Thu Sep 02 15:18:34 CDT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.apt.aptEnabled=true 4 | org.eclipse.jdt.apt.genSrcDir=.apt_generated 5 | org.eclipse.jdt.apt.reconcileEnabled=true 6 | 7 | org.eclipse.jdt.apt.processorOptions/kroll.jsonFile=titanium-in-app-purchase.json 8 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.abi.json: -------------------------------------------------------------------------------- 1 | { 2 | "ABIRoot": { 3 | "kind": "Root", 4 | "name": "TopLevel", 5 | "printedName": "TopLevel", 6 | "json_format_version": 8 7 | }, 8 | "ConstValues": [] 9 | } -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.abi.json: -------------------------------------------------------------------------------- 1 | { 2 | "ABIRoot": { 3 | "kind": "Root", 4 | "name": "TopLevel", 5 | "printedName": "TopLevel", 6 | "json_format_version": 8 7 | }, 8 | "ConstValues": [] 9 | } -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Resources/DWARF/SwiftyStoreKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Resources/DWARF/SwiftyStoreKit -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.abi.json: -------------------------------------------------------------------------------- 1 | { 2 | "ABIRoot": { 3 | "kind": "Root", 4 | "name": "TopLevel", 5 | "printedName": "TopLevel", 6 | "json_format_version": 8 7 | }, 8 | "ConstValues": [] 9 | } -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.abi.json: -------------------------------------------------------------------------------- 1 | { 2 | "ABIRoot": { 3 | "kind": "Root", 4 | "name": "TopLevel", 5 | "printedName": "TopLevel", 6 | "json_format_version": 8 7 | }, 8 | "ConstValues": [] 9 | } -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Resources/DWARF/SwiftyStoreKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Resources/DWARF/SwiftyStoreKit -------------------------------------------------------------------------------- /ios/timodule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-macos.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-macos.swiftdoc -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-macos.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-macos.swiftdoc -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-macos.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-macos.swiftmodule -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-macos.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-macos.swiftmodule -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.swiftdoc -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.swiftmodule -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.swiftdoc -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.swiftmodule -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/Project/arm64-apple-watchos-simulator.swiftsourceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/Project/arm64-apple-watchos-simulator.swiftsourceinfo -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/Project/x86_64-apple-watchos-simulator.swiftsourceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/titanium-iap/HEAD/ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Modules/SwiftyStoreKit.swiftmodule/Project/x86_64-apple-watchos-simulator.swiftsourceinfo -------------------------------------------------------------------------------- /android/timodule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Classes/TiIap.h: -------------------------------------------------------------------------------- 1 | // 2 | // TiIap.h 3 | // titanium-in-app-purchase 4 | // 5 | // Created by Your Name 6 | // Copyright (c) 2020 Your Company. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for TiIap. 12 | FOUNDATION_EXPORT double TiIapVersionNumber; 13 | 14 | //! Project version string for TiIap. 15 | FOUNDATION_EXPORT const unsigned char TiIapVersionString[]; 16 | 17 | #import "TiIapModuleAssets.h" 18 | -------------------------------------------------------------------------------- /ios/Classes/TiIapModuleAssets.m: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a generated file. Do not edit or your changes will be lost 3 | */ 4 | #import "TiIapModuleAssets.h" 5 | 6 | extern NSData* filterDataInRange(NSData* thedata, NSRange range); 7 | 8 | @implementation TiIapModuleAssets 9 | 10 | - (NSData *)moduleAsset 11 | { 12 | 13 | 14 | return nil; 15 | } 16 | 17 | - (NSData *)resolveModuleAsset:(NSString *)path 18 | { 19 | 20 | 21 | return nil; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | arguments= 2 | auto.sync=false 3 | build.scans.enabled=false 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.3)) 5 | connection.project.dir= 6 | eclipse.preferences.version=1 7 | gradle.user.home= 8 | java.home=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home 9 | jvm.arguments= 10 | offline.mode=false 11 | override.workspace.settings=true 12 | show.console.view=true 13 | show.executions.view=true 14 | -------------------------------------------------------------------------------- /android/platform/README.md: -------------------------------------------------------------------------------- 1 | Files in this folder are copied directory into the Android build directory 2 | when the Android app is compiled: 3 | 4 | /build/android 5 | 6 | You can place files such as res strings or drawable files. 7 | 8 | Files in this directory are copied directly on top of whatever files are already 9 | in the build directory, so please be careful that your files don't clobber 10 | essential project files or files from other modules. 11 | -------------------------------------------------------------------------------- /example/app.js: -------------------------------------------------------------------------------- 1 | import InAppPurchaseManager from './iap-manager'; 2 | 3 | const window = Ti.UI.createWindow(); 4 | window.addEventListener('open', () => InAppPurchaseManager.prepare()); 5 | window.addEventListener('close', () => InAppPurchaseManager.shutdown()); 6 | 7 | // TODO: Add UI around the product list and purchase button here 8 | // 9 | // const products = await InAppPurchaseManager.getProductInfos(); 10 | // const purchase = await InAppPurchaseManager.purchase('MY_PRODUCT_ID'); 11 | 12 | window.open(); -------------------------------------------------------------------------------- /ios/titanium.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // CHANGE THESE VALUES TO REFLECT THE VERSION (AND LOCATION IF DIFFERENT) 4 | // OF YOUR TITANIUM SDK YOU'RE BUILDING FOR 5 | // 6 | // 7 | TITANIUM_SDK_VERSION = 11.1.1.GA 8 | 9 | // 10 | // THESE SHOULD BE OK GENERALLY AS-IS 11 | // 12 | TITANIUM_SDK = /Users/$(USER)/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION) 13 | HEADER_SEARCH_PATHS = $(inherited) "$(TITANIUM_SDK)/iphone/include" 14 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(TITANIUM_SDK)/iphone/Frameworks/**" 15 | -------------------------------------------------------------------------------- /android/manifest: -------------------------------------------------------------------------------- 1 | # 2 | # this is your module manifest and used by Titanium 3 | # during compilation, packaging, distribution, etc. 4 | # 5 | version: 5.0.1 6 | apiversion: 4 7 | architectures: arm64-v8a armeabi-v7a x86 x86_64 8 | description: titanium-in-app-purchase 9 | author: Prashant Saini 10 | license: UNLICENSED 11 | copyright: Copyright (c) 2020-present by Hans Knöchel 12 | 13 | # these should not be edited 14 | name: titanium-in-app-purchase 15 | moduleid: ti.iap 16 | guid: c56ee43a-5a50-4a05-ad18-3f0e575557eb 17 | platform: android 18 | minsdk: 12.7.0 19 | -------------------------------------------------------------------------------- /ios/manifest: -------------------------------------------------------------------------------- 1 | # 2 | # this is your module manifest and used by Titanium 3 | # during compilation, packaging, distribution, etc. 4 | # 5 | version: 2.2.1 6 | apiversion: 2 7 | architectures: arm64 x86_64 8 | description: titanium-in-app-purchase is a Swift based Titanium module. 9 | author: Hans Knoechek 10 | license: UNLICENSED 11 | mac: false 12 | copyright: Copyright (c) 2020-present by Hans Knoechel 13 | 14 | # these should not be edited 15 | name: titanium-in-app-purchase 16 | moduleid: ti.iap 17 | guid: 8420a03d-cae0-48a0-92e5-e9ad9cda4c86 18 | platform: iphone 19 | minsdk: 11.0.0 20 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "kotlin-android" 2 | 3 | dependencies { 4 | implementation "androidx.core:core-ktx:1.3.0" 5 | 6 | // https://developer.android.com/google/play/billing/release-notes 7 | def inapp_version = "7.1.1" 8 | implementation "com.android.billingclient:billing:${inapp_version}" 9 | implementation "com.android.billingclient:billing-ktx:${inapp_version}" 10 | } 11 | 12 | // Prevent the "More than one file was found with OS independent path 'META-INF/module_release.kotlin_module'" error 13 | android { 14 | packagingOptions { 15 | exclude 'META-INF/*.kotlin_module' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Titanium In-App-Purchases 2 | 3 | Support for native cross-platform in-app-purchase API's in Titanium. 4 | This repository represents a modern alternative to ti.storekit (iOS) and ti.inappbilling (Android). 5 | 6 | ## Versions 7 | 8 | - Android: In App Billing v6 (6.0.1) 9 | - iOS: SwiftyStoreKit 0.16.4 10 | 11 | ## Requirements 12 | 13 | - [x] Titanium SDK 9.2.0+ 14 | 15 | ## Example 16 | 17 | See the [example/app.js](./example/app.js) and [example/iap-manager.js](./example/iap-manager.js) for an extensive, 100 % cross platform example. 18 | 19 | ## License 20 | 21 | MIT 22 | 23 | ## Author 24 | 25 | Hans Knöchel 26 | 27 | ## Copyright 28 | 29 | (c) 2022-present Hans Knöchel 30 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.musevisions.iOS.SwiftyStoreKit 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.musevisions.macOS.SwiftyStoreKit 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.musevisions.iOS.SwiftyStoreKit 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/dSYMs/SwiftyStoreKit.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.musevisions.iOS.SwiftyStoreKit 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /ios/module.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE 3 | // PICKED UP DURING THE APP BUILD FOR YOUR MODULE 4 | // 5 | // see the following webpage for instructions on the settings 6 | // for this file: 7 | // https://developer.apple.com/library/content/featuredarticles/XcodeConcepts/Concept-Build_Settings.html 8 | // 9 | 10 | // 11 | // How to manually add a Framework (example) 12 | // Note: Titanium SDK 6.2.2+ detects and links frameworks automatically 13 | // 14 | // OTHER_LDFLAGS=$(inherited) -framework Foo 15 | // 16 | // Adding a framework for a specific version(s) of iOS, e.g iOS 11: 17 | // 18 | // OTHER_LDFLAGS[sdk=iphoneos11*]=$(inherited) -framework Foo 19 | // OTHER_LDFLAGS[sdk=iphonesimulator11*]=$(inherited) -framework Foo 20 | // 21 | // 22 | // How to add a compiler define: 23 | // 24 | // OTHER_CFLAGS=$(inherited) -DFOO=1 25 | // 26 | // 27 | // IMPORTANT NOTE: always use $(inherited) in your overrides 28 | // 29 | -------------------------------------------------------------------------------- /android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /android/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Java 3 | AccessModifierOffset: -4 4 | AllowShortBlocksOnASingleLine: false 5 | AllowShortFunctionsOnASingleLine: None 6 | AllowShortIfStatementsOnASingleLine: false 7 | AllowShortLoopsOnASingleLine: false 8 | # class, constructor, method should be next line 9 | BreakBeforeBraces: Linux 10 | # Keep '=' at end of line when wrapping, but move things like '&&', '||' to beginning of newline 11 | BreakBeforeBinaryOperators: NonAssignment 12 | # FIXME: break for brace after synchronized block, anonymous class declarations 13 | BreakAfterJavaFieldAnnotations: true 14 | ColumnLimit: 120 15 | IndentCaseLabels: true 16 | IndentWidth: 4 17 | MaxEmptyLinesToKeep: 1 18 | SpaceBeforeAssignmentOperators: true 19 | SpaceBeforeParens: ControlStatements 20 | SpacesInParentheses: false 21 | TabWidth: 4 22 | UseTab: ForContinuationAndIndentation 23 | SpaceAfterCStyleCast: true 24 | # Spaces inside {} for array literals, i.e. "new Object[] { args }" 25 | Cpp11BracedListStyle: false 26 | ReflowComments: false 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright © 2022-present Hans Knöchel 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | titanium-in-app-purchase 4 | 5 | 6 | 7 | 8 | 9 | com.appcelerator.titanium.core.builder 10 | 11 | 12 | 13 | 14 | com.aptana.ide.core.unifiedBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.buildship.core.gradleprojectbuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.jdt.core.javanature 31 | com.appcelerator.titanium.mobile.module.nature 32 | com.aptana.projects.webnature 33 | org.eclipse.buildship.core.gradleprojectnature 34 | 35 | 36 | -------------------------------------------------------------------------------- /android/src/ti/iap/handlers/BillingConnectionHandler.kt: -------------------------------------------------------------------------------- 1 | package ti.iap.handlers 2 | 3 | import com.android.billingclient.api.BillingClient 4 | import com.android.billingclient.api.BillingClientStateListener 5 | import com.android.billingclient.api.BillingResult 6 | import org.appcelerator.kroll.KrollDict 7 | import org.appcelerator.kroll.KrollProxy 8 | import ti.iap.IAPConstants 9 | 10 | class BillingConnectionHandler(private var krollProxy: KrollProxy) : BillingClientStateListener { 11 | var isConnected = false 12 | 13 | override fun onBillingServiceDisconnected() { 14 | fireEvent() 15 | } 16 | 17 | override fun onBillingSetupFinished(billingResult: BillingResult) { 18 | fireEvent(billingResult.responseCode == BillingClient.BillingResponseCode.OK, billingResult.debugMessage) 19 | } 20 | 21 | private fun fireEvent(connected: Boolean = false, message: String? = null) { 22 | isConnected = connected 23 | 24 | val event = KrollDict() 25 | event[IAPConstants.Properties.SUCCESS] = isConnected 26 | message?.let { 27 | event[IAPConstants.Properties.MESSAGE] = message 28 | } 29 | 30 | krollProxy.fireEvent(IAPConstants.Events.ON_CONNECTION_UPDATE, event) 31 | } 32 | } -------------------------------------------------------------------------------- /ios/hooks/ti.swiftsupport.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Ti.SwiftSupport 3 | * Copyright (c) 2018-present by Axway Appcelerator. 4 | * All Rights Reserved. 5 | */ 6 | 7 | 'use strict'; 8 | 9 | exports.id = 'ti.swiftsupport'; 10 | exports.cliVersion = '>=3.2'; 11 | exports.init = init; 12 | 13 | /** 14 | * Main entry point for our plugin which looks for the platform specific 15 | * plugin to invoke. 16 | * 17 | * @param {Object} logger The logger instance. 18 | * @param {Object} config The hook config. 19 | * @param {Object} cli The Titanium CLI instance. 20 | * @param {Object} appc The Appcelerator CLI instance. 21 | */ 22 | // eslint-disable-next-line no-unused-vars 23 | function init(logger, config, cli, appc) { 24 | cli.on('build.ios.xcodeproject', { 25 | pre: function (data) { 26 | var xobjs = data.args[0].hash.project.objects; 27 | 28 | Object.keys(xobjs.PBXNativeTarget).forEach(function (targetUuid) { 29 | var target = xobjs.PBXNativeTarget[targetUuid]; 30 | if (target && typeof target === 'object') { 31 | console.warn(target); 32 | xobjs.XCConfigurationList[target.buildConfigurationList].buildConfigurations.forEach(function (buildConf) { 33 | var buildSettings = xobjs.XCBuildConfiguration[buildConf.value].buildSettings; 34 | buildSettings.ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = 'YES'; 35 | }); 36 | } 37 | }); 38 | } 39 | }); 40 | } 41 | -------------------------------------------------------------------------------- /android/src/ti/iap/models/SkuModel.kt: -------------------------------------------------------------------------------- 1 | package ti.iap.models 2 | 3 | import com.android.billingclient.api.SkuDetails 4 | import org.appcelerator.kroll.KrollDict 5 | import ti.iap.IAPConstants.SkuModelKeys 6 | 7 | class SkuModel(val skuDetails: SkuDetails) { 8 | val modelData: KrollDict get() { 9 | val modelDict = KrollDict() 10 | 11 | modelDict[SkuModelKeys.DESCRIPTION] = skuDetails.description 12 | modelDict[SkuModelKeys.ICON_URL] = skuDetails.iconUrl 13 | modelDict[SkuModelKeys.FREE_TRIAL_PERIOD] = skuDetails.freeTrialPeriod 14 | modelDict[SkuModelKeys.INTRODUCTORY_PRICE] = skuDetails.introductoryPrice 15 | modelDict[SkuModelKeys.INTRODUCTORY_PRICE_AMOUNT_MICROS] = skuDetails.introductoryPriceAmountMicros 16 | modelDict[SkuModelKeys.INTRODUCTORY_PRICE_CYCLES] = skuDetails.introductoryPriceCycles 17 | modelDict[SkuModelKeys.INTRODUCTORY_PRICE_PERIOD] = skuDetails.introductoryPricePeriod 18 | modelDict[SkuModelKeys.ORIGINAL_PRICE] = skuDetails.originalPrice 19 | modelDict[SkuModelKeys.ORIGINAL_PRICE_AMOUNT_MICROS] = skuDetails.originalPriceAmountMicros 20 | modelDict[SkuModelKeys.PRICE] = skuDetails.price 21 | modelDict[SkuModelKeys.PRICE_AMOUNT_MICROS] = skuDetails.priceAmountMicros 22 | modelDict[SkuModelKeys.PRICE_CURRENCY_CODE] = skuDetails.priceCurrencyCode 23 | modelDict[SkuModelKeys.PRODUCT_ID] = skuDetails.sku 24 | modelDict[SkuModelKeys.SUBSCRIPTION_PERIOD] = skuDetails.subscriptionPeriod 25 | modelDict[SkuModelKeys.TITLE] = skuDetails.title 26 | modelDict[SkuModelKeys.TYPE] = skuDetails.type 27 | 28 | return modelDict 29 | } 30 | } -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 22A400 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | SwiftyStoreKit 11 | CFBundleIdentifier 12 | com.musevisions.macOS.SwiftyStoreKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SwiftyStoreKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 14B47b 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 13.0 37 | DTSDKBuild 38 | 22A372 39 | DTSDKName 40 | macosx13.0 41 | DTXcode 42 | 1410 43 | DTXcodeBuild 44 | 14B47b 45 | LSMinimumSystemVersion 46 | 10.10 47 | NSHumanReadableCopyright 48 | Copyright © 2015 musevisions. All rights reserved. 49 | 50 | 51 | -------------------------------------------------------------------------------- /android/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ant build script for Titanium Android module titanium-in-app-purchase 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /android/java-sources.txt: -------------------------------------------------------------------------------- 1 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/src/ti/iap/ProductProxy.java" 2 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/src/ti/iap/TitaniumInAppPurchaseModule.java" 3 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/java/ti/iap/CommonJsSourceProvider.java" 4 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/java/ti/iap/TitaniumInAppPurchaseBootstrap.java" 5 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/compat/R.java" 6 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/coreui/R.java" 7 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/coreutils/R.java" 8 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/design/R.java" 9 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/exifinterface/R.java" 10 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/fragment/R.java" 11 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/graphics/drawable/R.java" 12 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/graphics/drawable/animated/R.java" 13 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/mediacompat/R.java" 14 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/transition/R.java" 15 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/v4/R.java" 16 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/v7/appcompat/R.java" 17 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/v7/cardview/R.java" 18 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/android/support/v7/recyclerview/R.java" 19 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/com/android/billingclient/R.java" 20 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/ti/iap/R.java" 21 | "/Users/hans/Documents/dev/titanium/titanium-iap/android/build/generated/r/ti/modules/titanium/ui/R.java" -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AvailableLibraries 6 | 7 | 8 | DebugSymbolsPath 9 | dSYMs 10 | LibraryIdentifier 11 | ios-arm64_x86_64-simulator 12 | LibraryPath 13 | SwiftyStoreKit.framework 14 | SupportedArchitectures 15 | 16 | arm64 17 | x86_64 18 | 19 | SupportedPlatform 20 | ios 21 | SupportedPlatformVariant 22 | simulator 23 | 24 | 25 | DebugSymbolsPath 26 | dSYMs 27 | LibraryIdentifier 28 | ios-arm64 29 | LibraryPath 30 | SwiftyStoreKit.framework 31 | SupportedArchitectures 32 | 33 | arm64 34 | 35 | SupportedPlatform 36 | ios 37 | 38 | 39 | DebugSymbolsPath 40 | dSYMs 41 | LibraryIdentifier 42 | watchos-arm64_x86_64-simulator 43 | LibraryPath 44 | SwiftyStoreKit.framework 45 | SupportedArchitectures 46 | 47 | arm64 48 | x86_64 49 | 50 | SupportedPlatform 51 | watchos 52 | SupportedPlatformVariant 53 | simulator 54 | 55 | 56 | DebugSymbolsPath 57 | dSYMs 58 | LibraryIdentifier 59 | macos-arm64_x86_64 60 | LibraryPath 61 | SwiftyStoreKit.framework 62 | SupportedArchitectures 63 | 64 | arm64 65 | x86_64 66 | 67 | SupportedPlatform 68 | macos 69 | 70 | 71 | CFBundlePackageType 72 | XFWK 73 | XCFrameworkFormatVersion 74 | 1.0 75 | 76 | 77 | -------------------------------------------------------------------------------- /android/src/ti/iap/IAPConstants.kt: -------------------------------------------------------------------------------- 1 | package ti.iap 2 | 3 | object IAPConstants { 4 | object Properties { 5 | const val MESSAGE = "message" 6 | const val SUCCESS = "success" 7 | const val CODE = "code" 8 | const val CALLBACK = "callback" 9 | const val PRODUCT_TYPE = "productType" 10 | const val PRODUCT_LIST = "productList" 11 | const val PRODUCT_ID_LIST = "productIdList" 12 | const val PURCHASE_LIST = "purchaseList" 13 | } 14 | 15 | object PurchaseModelKeys { 16 | const val PURCHASE_TOKEN = "purchaseToken" 17 | const val PRODUCT_ID = "productId" 18 | const val PRODUCT_IDS = "productIds" // Added in Play Billing v4+ 19 | const val ORDER_ID = "orderId" 20 | const val QUANTITY = "quantity" 21 | const val DEVELOPER_PAYLOAD = "developerPayload" 22 | const val ORIGINAL_JSON = "originalJson" 23 | const val PACKAGE_NAME = "packageName" 24 | const val PURCHASE_STATE = "purchaseState" 25 | const val PURCHASE_TIME = "purchaseTime" 26 | const val SIGNATURE = "signature" 27 | const val IS_ACKNOWLEDGED = "isAcknowledged" 28 | const val IS_AUTORENEWING = "isAutoRenewing" 29 | const val OBFUSCATED_ACCOUNT_ID = "obfuscatedAccountId" 30 | const val OBFUSCATED_PROFILE_ID = "obfuscatedProfileId" 31 | } 32 | 33 | object SkuModelKeys { 34 | const val DESCRIPTION = "description" 35 | const val ICON_URL = "iconUrl" 36 | const val FREE_TRIAL_PERIOD = "freeTrialPeriod" 37 | const val INTRODUCTORY_PRICE = "introductoryPrice" 38 | const val INTRODUCTORY_PRICE_AMOUNT_MICROS = "introductoryPriceAmountMicros" 39 | const val INTRODUCTORY_PRICE_CYCLES = "introductoryPriceCycles" 40 | const val INTRODUCTORY_PRICE_PERIOD = "introductoryPricePeriod" 41 | const val ORIGINAL_JSON = "originalJson" 42 | const val ORIGINAL_PRICE = "originalPrice" 43 | const val ORIGINAL_PRICE_AMOUNT_MICROS = "originalPriceAmountMicros" 44 | const val PRICE = "price" 45 | const val PRICE_AMOUNT_MICROS = "priceAmountMicros" 46 | const val PRICE_CURRENCY_CODE = "priceCurrencyCode" 47 | const val PRODUCT_ID = "productId" 48 | const val SUBSCRIPTION_PERIOD = "subscriptionPeriod" 49 | const val TITLE = "title" 50 | const val TYPE = "type" 51 | } 52 | 53 | object Events { 54 | const val ON_CONNECTION_UPDATE = "connectionUpdate" 55 | const val ON_PURCHASE_UPDATE = "purchaseUpdate" 56 | } 57 | } -------------------------------------------------------------------------------- /android/src/ti/iap/handlers/PurchaseHandler.kt: -------------------------------------------------------------------------------- 1 | package ti.iap.handlers 2 | 3 | import com.android.billingclient.api.* 4 | import org.appcelerator.kroll.KrollDict 5 | import org.appcelerator.kroll.KrollProxy 6 | import ti.iap.IAPConstants 7 | import ti.iap.models.PurchaseModel 8 | 9 | class PurchaseHandler(private var krollProxy: KrollProxy) : PurchasesUpdatedListener { 10 | companion object { 11 | @JvmStatic val purchaseCatalog = ArrayList() 12 | 13 | @JvmStatic fun updatePurchaseList(purchaseList: List) { 14 | // first update the existing SKUs 15 | for (purchase in purchaseList) { 16 | for (i in purchaseCatalog.indices) { 17 | // if purchase-token is matched, update the purchase model 18 | if (purchaseCatalog[i].purchase.purchaseToken == purchase.purchaseToken) { 19 | purchaseCatalog[i] = PurchaseModel(purchase) 20 | break 21 | } 22 | } 23 | } 24 | 25 | // finally add all new SKUs 26 | for (purchase in purchaseList) { 27 | var isPurchaseAvailable = false 28 | 29 | for (purchaseModel in purchaseCatalog) { 30 | if (purchaseModel.purchase.purchaseToken == purchase.purchaseToken) { 31 | isPurchaseAvailable = true 32 | break 33 | } 34 | } 35 | 36 | // add if sku is not available in our sku-catalog list 37 | if (!isPurchaseAvailable) { 38 | purchaseCatalog.add(PurchaseModel(purchase)) 39 | } 40 | } 41 | } 42 | } 43 | 44 | override fun onPurchasesUpdated(billingResult: BillingResult, purchaseList: List?) { 45 | val isSuccess = billingResult.responseCode == BillingClient.BillingResponseCode.OK 46 | val purchaseResult = ArrayList() 47 | 48 | if (purchaseList != null) { 49 | for (purchase in purchaseList) { 50 | purchaseResult.add( PurchaseModel(purchase).modelData ) 51 | } 52 | 53 | updatePurchaseList(purchaseList) 54 | } 55 | 56 | val resultData = KrollDict() 57 | resultData[IAPConstants.Properties.SUCCESS] = isSuccess 58 | resultData[IAPConstants.Properties.CODE] = billingResult.responseCode 59 | resultData[IAPConstants.Properties.PURCHASE_LIST] = purchaseResult.toTypedArray() 60 | krollProxy.fireEvent(IAPConstants.Events.ON_PURCHASE_UPDATE, resultData) 61 | } 62 | } -------------------------------------------------------------------------------- /android/src/ti/iap/handlers/ProductsHandler.kt: -------------------------------------------------------------------------------- 1 | package ti.iap.handlers 2 | 3 | import com.android.billingclient.api.BillingClient.BillingResponseCode.OK 4 | import com.android.billingclient.api.BillingResult 5 | import com.android.billingclient.api.SkuDetails 6 | import com.android.billingclient.api.SkuDetailsResponseListener 7 | import org.appcelerator.kroll.KrollDict 8 | import org.appcelerator.kroll.KrollFunction 9 | import org.appcelerator.kroll.KrollObject 10 | import org.appcelerator.kroll.common.Log 11 | import ti.iap.IAPConstants 12 | import ti.iap.models.SkuModel 13 | 14 | class ProductsHandler(private val callback: KrollFunction?, private val krollObject: KrollObject): SkuDetailsResponseListener { 15 | companion object { 16 | @JvmStatic val skuList = ArrayList() 17 | 18 | @JvmStatic fun getSkuDetails(productId: String): SkuDetails? { 19 | var skuDetails: SkuDetails? = null 20 | 21 | Log.w("IAP", productId); 22 | Log.w("IAP", skuList.toString()); 23 | 24 | for (skuModel in skuList) { 25 | if (skuModel.skuDetails.sku == productId) { 26 | skuDetails = skuModel.skuDetails 27 | break 28 | } 29 | } 30 | 31 | return skuDetails 32 | } 33 | 34 | @JvmStatic fun updateProductList(skuDetailsList: MutableList) { 35 | // first update the existing SKUs 36 | for (skuDetails in skuDetailsList) { 37 | for (i in skuList.indices) { 38 | // if sku-id is matched, update the sku 39 | if (skuList[i].skuDetails.sku == skuDetails.sku) { 40 | skuList[i] = SkuModel(skuDetails) 41 | break 42 | } 43 | } 44 | } 45 | 46 | // finally add all new SKUs 47 | for (skuDetails in skuDetailsList) { 48 | var isSkuAvailable = false 49 | 50 | for (skuModel in skuList) { 51 | if (skuModel.skuDetails.sku == skuDetails.sku) { 52 | isSkuAvailable = true 53 | break 54 | } 55 | } 56 | 57 | // add if sku is not available in our sku-catalog list 58 | if (!isSkuAvailable) { 59 | skuList.add(SkuModel(skuDetails)) 60 | } 61 | } 62 | } 63 | } 64 | 65 | override fun onSkuDetailsResponse(billingResult: BillingResult, skuDetailsList: MutableList?) { 66 | val success = billingResult.responseCode == OK && skuDetailsList != null 67 | val productList = ArrayList() 68 | 69 | if (skuDetailsList != null) { 70 | for (skuDetails in skuDetailsList) { 71 | productList.add(SkuModel(skuDetails).modelData) 72 | } 73 | 74 | // update locally saved products' details 75 | updateProductList(skuDetailsList) 76 | } 77 | 78 | val resultData = KrollDict() 79 | resultData[IAPConstants.Properties.SUCCESS] = success 80 | resultData[IAPConstants.Properties.CODE] = billingResult.responseCode 81 | resultData[IAPConstants.Properties.PRODUCT_LIST] = productList.toTypedArray() 82 | 83 | callback?.callAsync(krollObject, resultData) 84 | } 85 | } -------------------------------------------------------------------------------- /android/src/ti/iap/models/PurchaseModel.kt: -------------------------------------------------------------------------------- 1 | package ti.iap.models 2 | 3 | import com.android.billingclient.api.Purchase 4 | import com.android.billingclient.api.PurchaseHistoryRecord 5 | import org.appcelerator.kroll.KrollDict 6 | import ti.iap.IAPConstants.PurchaseModelKeys 7 | 8 | class PurchaseModel(val purchase: Purchase) { 9 | companion object { 10 | @JvmStatic fun createPurchaseData(purchase: Purchase): KrollDict { 11 | val modelDict = KrollDict() 12 | 13 | modelDict[PurchaseModelKeys.PURCHASE_TOKEN] = purchase.purchaseToken // primary-key and globally unique, can be used in database records safely 14 | modelDict[PurchaseModelKeys.PRODUCT_ID] = purchase.skus.first() 15 | modelDict[PurchaseModelKeys.PRODUCT_IDS] = purchase.skus 16 | modelDict[PurchaseModelKeys.ORDER_ID] = purchase.orderId 17 | modelDict[PurchaseModelKeys.QUANTITY] = purchase.quantity 18 | modelDict[PurchaseModelKeys.DEVELOPER_PAYLOAD] = purchase.developerPayload 19 | // modelDict[PurchaseModelKeys.ORIGINAL_JSON] = purchase.originalJson 20 | modelDict[PurchaseModelKeys.PACKAGE_NAME] = purchase.packageName 21 | modelDict[PurchaseModelKeys.PURCHASE_STATE] = purchase.purchaseState 22 | modelDict[PurchaseModelKeys.PURCHASE_TIME] = purchase.purchaseTime 23 | modelDict[PurchaseModelKeys.SIGNATURE] = purchase.signature 24 | modelDict[PurchaseModelKeys.IS_ACKNOWLEDGED] = purchase.isAcknowledged 25 | modelDict[PurchaseModelKeys.IS_AUTORENEWING] = purchase.isAutoRenewing 26 | modelDict[PurchaseModelKeys.OBFUSCATED_ACCOUNT_ID] = purchase.accountIdentifiers?.obfuscatedAccountId ?: "" 27 | modelDict[PurchaseModelKeys.OBFUSCATED_PROFILE_ID] = purchase.accountIdentifiers?.obfuscatedAccountId ?: "" 28 | 29 | return modelDict 30 | } 31 | 32 | @JvmStatic fun createPurchaseHistoryRecord(purchaseHistoryRecord: PurchaseHistoryRecord): KrollDict { 33 | val modelDict = KrollDict() 34 | 35 | modelDict[PurchaseModelKeys.PURCHASE_TOKEN] = purchaseHistoryRecord.purchaseToken // primary-key and globally unique, can be used in database records safely 36 | modelDict[PurchaseModelKeys.PRODUCT_ID] = purchaseHistoryRecord.skus.first() 37 | modelDict[PurchaseModelKeys.PRODUCT_IDS] = purchaseHistoryRecord.skus.toTypedArray() 38 | modelDict[PurchaseModelKeys.ORDER_ID] = null 39 | modelDict[PurchaseModelKeys.QUANTITY] = purchaseHistoryRecord.quantity 40 | modelDict[PurchaseModelKeys.DEVELOPER_PAYLOAD] = purchaseHistoryRecord.developerPayload 41 | // modelDict[PurchaseModelKeys.ORIGINAL_JSON] = purchaseHistoryRecord.originalJson 42 | modelDict[PurchaseModelKeys.PACKAGE_NAME] = null 43 | modelDict[PurchaseModelKeys.PURCHASE_STATE] = null 44 | modelDict[PurchaseModelKeys.PURCHASE_TIME] = purchaseHistoryRecord.purchaseTime 45 | modelDict[PurchaseModelKeys.SIGNATURE] = purchaseHistoryRecord.signature 46 | modelDict[PurchaseModelKeys.IS_ACKNOWLEDGED] = null 47 | modelDict[PurchaseModelKeys.IS_AUTORENEWING] = null 48 | modelDict[PurchaseModelKeys.OBFUSCATED_ACCOUNT_ID] = null 49 | modelDict[PurchaseModelKeys.OBFUSCATED_PROFILE_ID] = null 50 | 51 | return modelDict 52 | } 53 | } 54 | 55 | val modelData: KrollDict get() { 56 | return createPurchaseData(this.purchase) 57 | } 58 | } -------------------------------------------------------------------------------- /ios/Classes/TiIapProductProxy.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * Axway Titanium 3 | * Copyright (c) 2018-present by Axway Appcelerator. All Rights Reserved. 4 | * Licensed under the terms of the Apache Public License 5 | * Please see the LICENSE included with this distribution for details. 6 | */ 7 | 8 | import TitaniumKit 9 | import StoreKit 10 | 11 | @objc(TiIapProductProxy) 12 | public class TiIapProductProxy: TiProxy { 13 | 14 | private var product: SKProduct? 15 | 16 | public func _init(withPageContext context: TiEvaluator!, product: SKProduct) -> Self? { 17 | super._init(withPageContext: context) 18 | self.product = product 19 | 20 | return self 21 | } 22 | 23 | @objc(identifier) 24 | func identifier() -> String { 25 | return product!.productIdentifier 26 | } 27 | 28 | @objc(localizedTitle) 29 | func localizedTitle() -> String { 30 | return product!.localizedTitle 31 | } 32 | 33 | @objc(localizedDescription) 34 | func localizedDescription() -> String { 35 | return product!.localizedDescription 36 | } 37 | 38 | @objc(price) 39 | func price() -> Double { 40 | return product!.price.doubleValue 41 | } 42 | 43 | @objc(introductoryPrice) 44 | func introductoryPrice() -> [String: Any] { 45 | guard #available(iOS 11.2, *), let introductoryPrice = product!.introductoryPrice else { 46 | return [:] 47 | } 48 | 49 | if #available(iOS 12.2, *) { 50 | return [ 51 | "identifier": introductoryPrice.identifier ?? "", 52 | "localizedPrice": introductoryPrice.localizedPrice ?? "", 53 | "price": introductoryPrice.price, 54 | "localizedSubscriptionPeriod": introductoryPrice.localizedSubscriptionPeriod, 55 | "numberOfPeriods": introductoryPrice.numberOfPeriods, 56 | "paymentMode": introductoryPrice.paymentMode.rawValue, 57 | "subscriptionPeriod": [ 58 | "unit": introductoryPrice.subscriptionPeriod.unit.rawValue, 59 | "numberOfUnits": introductoryPrice.subscriptionPeriod.numberOfUnits 60 | ] 61 | ] 62 | } 63 | 64 | return [ 65 | "localizedPrice": introductoryPrice.localizedPrice ?? "", 66 | "localizedSubscriptionPeriod": introductoryPrice.localizedSubscriptionPeriod, 67 | "numberOfPeriods": introductoryPrice.numberOfPeriods 68 | ] 69 | } 70 | 71 | @objc(discounts) 72 | func discounts() -> [[String: Any]] { 73 | guard #available(iOS 12.2, *) else { 74 | return [] 75 | } 76 | 77 | return product!.discounts.map { (productDiscount) -> [String: Any] in 78 | [ 79 | "identifier": productDiscount.identifier ?? "", 80 | "price": productDiscount.price.doubleValue, 81 | // --> These are crashing on iOS 13 right now 82 | // 83 | // "localizedPrice": productDiscount.localizedPrice ?? "", 84 | // "priceLocale": productDiscount.priceLocale.identifier, 85 | // "localizedSubscriptionPeriod": productDiscount.localizedSubscriptionPeriod, 86 | "subscriptionPeriod": [ 87 | "numberOfUnits": productDiscount.subscriptionPeriod.numberOfUnits, 88 | "unit": productDiscount.subscriptionPeriod.unit.rawValue 89 | ], 90 | "numberOfPeriods": productDiscount.numberOfPeriods, 91 | "paymentMode": productDiscount.paymentMode.rawValue, 92 | "type": productDiscount.type.rawValue 93 | ] 94 | } 95 | } 96 | 97 | @objc(priceCurrencyCode) 98 | func priceCurrencyCode() -> String? { 99 | return product!.priceLocale.currencyCode 100 | } 101 | 102 | @objc(localizedPrice) 103 | func localizedPrice() -> String { 104 | return priceStringForProduct() ?? "\(price())" 105 | } 106 | 107 | func toObject() -> [String: Any] { 108 | var payload: [String: Any] = [ 109 | "identifier": identifier(), 110 | "price": price(), 111 | "localizedPrice": localizedPrice(), 112 | "localizedTitle": localizedTitle(), 113 | "localizedDescription": localizedDescription(), 114 | "introductoryPrice": introductoryPrice(), 115 | "discounts": discounts() 116 | ] 117 | 118 | if let priceCurrencyCode = priceCurrencyCode() { 119 | payload["priceCurrencyCode"] = priceCurrencyCode 120 | } 121 | 122 | return payload 123 | } 124 | 125 | private func priceStringForProduct() -> String? { 126 | let numberFormatter = NumberFormatter() 127 | let price = product!.price 128 | let locale = product!.priceLocale 129 | 130 | numberFormatter.numberStyle = .currency 131 | numberFormatter.locale = locale 132 | 133 | return numberFormatter.string(from: price) 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /android/src/ti/iap/helper/QueryHandler.kt: -------------------------------------------------------------------------------- 1 | package ti.iap.helper 2 | 3 | import com.android.billingclient.api.* 4 | import com.android.billingclient.api.BillingClient.BillingResponseCode.* 5 | import org.appcelerator.kroll.KrollDict 6 | import org.appcelerator.kroll.KrollFunction 7 | import org.appcelerator.kroll.KrollObject 8 | import ti.iap.IAPConstants 9 | import ti.iap.TitaniumInAppPurchaseModule 10 | import ti.iap.handlers.ProductsHandler 11 | import ti.iap.models.PurchaseModel 12 | 13 | object QueryHandler { 14 | // acknowledge non-consumable in-app products 15 | fun acknowledgeNonConsumableProduct(billingClient: BillingClient, args: KrollDict, krollObject: KrollObject) { 16 | val callback = args[IAPConstants.Properties.CALLBACK] as KrollFunction? 17 | val purchaseToken = args.getString(IAPConstants.PurchaseModelKeys.PURCHASE_TOKEN) 18 | val acknowledgePurchaseParams = AcknowledgePurchaseParams.newBuilder().setPurchaseToken(purchaseToken).build() 19 | 20 | val acknowledgePurchaseResponseListener = AcknowledgePurchaseResponseListener { billingResult -> 21 | val resultData = KrollDict() 22 | resultData[IAPConstants.Properties.CODE] = billingResult.responseCode 23 | resultData[IAPConstants.Properties.SUCCESS] = billingResult.responseCode == OK 24 | callback?.callAsync(krollObject, resultData) 25 | } 26 | 27 | billingClient.acknowledgePurchase(acknowledgePurchaseParams, acknowledgePurchaseResponseListener) 28 | } 29 | 30 | // acknowledge consumable in-app products 31 | fun acknowledgeConsumableProduct(billingClient: BillingClient, args: KrollDict, krollObject: KrollObject) { 32 | val callback = args[IAPConstants.Properties.CALLBACK] as KrollFunction? 33 | val purchaseToken = args.getString(IAPConstants.PurchaseModelKeys.PURCHASE_TOKEN) 34 | val consumeParams = ConsumeParams.newBuilder().setPurchaseToken(purchaseToken).build() 35 | 36 | 37 | val consumeResponseListener = ConsumeResponseListener { billingResult, updatedPurchaseToken -> 38 | val resultData = KrollDict() 39 | resultData[IAPConstants.Properties.CODE] = billingResult.responseCode 40 | resultData[IAPConstants.Properties.SUCCESS] = billingResult.responseCode == OK 41 | resultData[IAPConstants.PurchaseModelKeys.PURCHASE_TOKEN] = updatedPurchaseToken 42 | callback?.callAsync(krollObject, resultData) 43 | } 44 | 45 | billingClient.consumeAsync(consumeParams, consumeResponseListener) 46 | } 47 | 48 | // fetch products info from Google 49 | fun fetchProductsInfo(billingClient: BillingClient, args: KrollDict, krollObject: KrollObject) { 50 | val callback = args[IAPConstants.Properties.CALLBACK] as KrollFunction? 51 | val productIdList = args.getStringArray(IAPConstants.Properties.PRODUCT_ID_LIST) 52 | val productType = args.optString(IAPConstants.Properties.PRODUCT_TYPE, TitaniumInAppPurchaseModule.SKU_TYPE_INAPP) 53 | val skuList = ArrayList() 54 | 55 | for (productID in productIdList) { 56 | skuList.add(productID) 57 | } 58 | 59 | val skuDetailsParams = SkuDetailsParams.newBuilder() 60 | skuDetailsParams.setSkusList(skuList).setType(productType) 61 | 62 | val productsHandler = ProductsHandler(callback, krollObject) 63 | billingClient.querySkuDetailsAsync(skuDetailsParams.build(), productsHandler as SkuDetailsResponseListener) 64 | } 65 | 66 | // fetch recent purchases records 67 | fun queryPurchaseHistoryAsync(billingClient: BillingClient, args: KrollDict, krollObject: KrollObject) { 68 | val callback = args[IAPConstants.Properties.CALLBACK] as KrollFunction? 69 | val productType = args.getString(IAPConstants.Properties.PRODUCT_TYPE) 70 | 71 | val purchaseHistoryResponseListener = PurchaseHistoryResponseListener { billingResult, purchaseHistoryRecordList -> 72 | val resultData = KrollDict() 73 | resultData[IAPConstants.Properties.CODE] = billingResult.responseCode 74 | resultData[IAPConstants.Properties.SUCCESS] = billingResult.responseCode == OK 75 | 76 | val purchaseList = ArrayList() 77 | 78 | if (purchaseHistoryRecordList != null) { 79 | for (purchaseRecord in purchaseHistoryRecordList) { 80 | purchaseList.add(PurchaseModel.createPurchaseHistoryRecord(purchaseRecord)) 81 | } 82 | } 83 | 84 | resultData[IAPConstants.Properties.PURCHASE_LIST] = purchaseList.toTypedArray() 85 | 86 | callback?.callAsync(krollObject, resultData) 87 | } 88 | 89 | billingClient.queryPurchaseHistoryAsync(productType, purchaseHistoryResponseListener) 90 | } 91 | } -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Headers/SwiftyStoreKit-Swift.h 8 | 9 | fthNgI2ThGlY0gNYkc6tiBLD0Qg= 10 | 11 | Info.plist 12 | 13 | wt92oeZzV70gyb0IJiJ+3lfF0p8= 14 | 15 | Modules/SwiftyStoreKit.swiftmodule/Project/arm64-apple-watchos-simulator.swiftsourceinfo 16 | 17 | foxBjA6mlojzX5Hgcfa+y4m9G0U= 18 | 19 | Modules/SwiftyStoreKit.swiftmodule/Project/x86_64-apple-watchos-simulator.swiftsourceinfo 20 | 21 | u5+6V2eeS+MyR8fe9oV8kuQWD8U= 22 | 23 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.abi.json 24 | 25 | FSPnLbho3G+LL9smI3XgVOqBIQ4= 26 | 27 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.swiftdoc 28 | 29 | JrxVqtK5SsqTG1EL30V4ixOnkNw= 30 | 31 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.swiftmodule 32 | 33 | nt20dxwstv8eC6ui3tgicZqktdI= 34 | 35 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.abi.json 36 | 37 | FSPnLbho3G+LL9smI3XgVOqBIQ4= 38 | 39 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.swiftdoc 40 | 41 | CGW2RFlMAOgu7DQRZrhrrP2p7tk= 42 | 43 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.swiftmodule 44 | 45 | hWrkuM61vo3NmCZoIelab4b89vk= 46 | 47 | Modules/module.modulemap 48 | 49 | EVexB1o9liUvlwEH3tRMNo3AU2c= 50 | 51 | 52 | files2 53 | 54 | Headers/SwiftyStoreKit-Swift.h 55 | 56 | hash2 57 | 58 | VdZY8mCjmp96s0+QJTXSEePFN29mWQ5RyzJh+0QFsUs= 59 | 60 | 61 | Modules/SwiftyStoreKit.swiftmodule/Project/arm64-apple-watchos-simulator.swiftsourceinfo 62 | 63 | hash2 64 | 65 | kxl7EODbn0zpkMiCFYSajk/SOA+ydFXBFB2AJtIyrZ8= 66 | 67 | 68 | Modules/SwiftyStoreKit.swiftmodule/Project/x86_64-apple-watchos-simulator.swiftsourceinfo 69 | 70 | hash2 71 | 72 | DtlrF5xDuYJEXbPv6/F/ksM21+ZPE2KnydspRRjkVb8= 73 | 74 | 75 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.abi.json 76 | 77 | hash2 78 | 79 | KnRdWE4y6t4QM5zi5JDptPdHFgJy1Tku+7GLkZS2aNM= 80 | 81 | 82 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.swiftdoc 83 | 84 | hash2 85 | 86 | so6uRM3U46g7xWIBoQzrdKt3tZ8p6XtCW+k8AMltYJM= 87 | 88 | 89 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-watchos-simulator.swiftmodule 90 | 91 | hash2 92 | 93 | zIgAhQ/27hAgT1Tu7ttRIlmGCtQpZdxh3X1HdONlKjQ= 94 | 95 | 96 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.abi.json 97 | 98 | hash2 99 | 100 | KnRdWE4y6t4QM5zi5JDptPdHFgJy1Tku+7GLkZS2aNM= 101 | 102 | 103 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.swiftdoc 104 | 105 | hash2 106 | 107 | GQMI+jWvmCDIcj5itjLhit8PmYeeiuvUnR0BlFIpsV8= 108 | 109 | 110 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-watchos-simulator.swiftmodule 111 | 112 | hash2 113 | 114 | QpsG4UERoV2lvLLHiR8hLbAUmTqgwceAafnEfGpO1Rg= 115 | 116 | 117 | Modules/module.modulemap 118 | 119 | hash2 120 | 121 | D0YEqvGt6EFuEQbhVUE2tRF5UrcXApz3x3/2mnWAP2I= 122 | 123 | 124 | 125 | rules 126 | 127 | ^.* 128 | 129 | ^.*\.lproj/ 130 | 131 | optional 132 | 133 | weight 134 | 1000 135 | 136 | ^.*\.lproj/locversion.plist$ 137 | 138 | omit 139 | 140 | weight 141 | 1100 142 | 143 | ^Base\.lproj/ 144 | 145 | weight 146 | 1010 147 | 148 | ^version.plist$ 149 | 150 | 151 | rules2 152 | 153 | .*\.dSYM($|/) 154 | 155 | weight 156 | 11 157 | 158 | ^(.*/)?\.DS_Store$ 159 | 160 | omit 161 | 162 | weight 163 | 2000 164 | 165 | ^.* 166 | 167 | ^.*\.lproj/ 168 | 169 | optional 170 | 171 | weight 172 | 1000 173 | 174 | ^.*\.lproj/locversion.plist$ 175 | 176 | omit 177 | 178 | weight 179 | 1100 180 | 181 | ^Base\.lproj/ 182 | 183 | weight 184 | 1010 185 | 186 | ^Info\.plist$ 187 | 188 | omit 189 | 190 | weight 191 | 20 192 | 193 | ^PkgInfo$ 194 | 195 | omit 196 | 197 | weight 198 | 20 199 | 200 | ^embedded\.provisionprofile$ 201 | 202 | weight 203 | 20 204 | 205 | ^version\.plist$ 206 | 207 | weight 208 | 20 209 | 210 | 211 | 212 | 213 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64_x86_64-simulator/SwiftyStoreKit.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Headers/SwiftyStoreKit-Swift.h 8 | 9 | NiYLFv7lglbe8yuGHZY+5DMgt00= 10 | 11 | Info.plist 12 | 13 | nwNdjNwztrbtjfyF4C1lwd9ZKjM= 14 | 15 | Modules/SwiftyStoreKit.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo 16 | 17 | QOG/XwenKUn3ZFT0eL9QbpKmVLk= 18 | 19 | Modules/SwiftyStoreKit.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo 20 | 21 | kivdgf38AKBlZN6wwXBY84uZeWw= 22 | 23 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.abi.json 24 | 25 | FSPnLbho3G+LL9smI3XgVOqBIQ4= 26 | 27 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc 28 | 29 | yG6c3Pq6ps6DAKTvyemvB9NYQus= 30 | 31 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule 32 | 33 | 3PVwCArEkkzpGwoDdEB1FKB/jVo= 34 | 35 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.abi.json 36 | 37 | FSPnLbho3G+LL9smI3XgVOqBIQ4= 38 | 39 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc 40 | 41 | QIcVtCZcH4L/QWZoV/zrI6Za5WI= 42 | 43 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule 44 | 45 | VHpqsw1oP5+jnh2iKNx89kYbDYI= 46 | 47 | Modules/module.modulemap 48 | 49 | EVexB1o9liUvlwEH3tRMNo3AU2c= 50 | 51 | 52 | files2 53 | 54 | Headers/SwiftyStoreKit-Swift.h 55 | 56 | hash 57 | 58 | NiYLFv7lglbe8yuGHZY+5DMgt00= 59 | 60 | hash2 61 | 62 | tPxPGXH3x0qIUO11VbpGk3A0IKdCTbUghKl/74pGHSI= 63 | 64 | 65 | Modules/SwiftyStoreKit.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo 66 | 67 | hash 68 | 69 | QOG/XwenKUn3ZFT0eL9QbpKmVLk= 70 | 71 | hash2 72 | 73 | sH1yxFKN1+AKRrePGQ/xlL+n8CiYJhPp0G8uDS7CoKI= 74 | 75 | 76 | Modules/SwiftyStoreKit.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo 77 | 78 | hash 79 | 80 | kivdgf38AKBlZN6wwXBY84uZeWw= 81 | 82 | hash2 83 | 84 | 90NVpQygRdfP37Sf2JRIR4zUeHOjUmd1EwVhgxSKM2U= 85 | 86 | 87 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.abi.json 88 | 89 | hash 90 | 91 | FSPnLbho3G+LL9smI3XgVOqBIQ4= 92 | 93 | hash2 94 | 95 | KnRdWE4y6t4QM5zi5JDptPdHFgJy1Tku+7GLkZS2aNM= 96 | 97 | 98 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc 99 | 100 | hash 101 | 102 | yG6c3Pq6ps6DAKTvyemvB9NYQus= 103 | 104 | hash2 105 | 106 | go0tU4HrnhUuwpnz37UIxGLjFzQfm72zstLP8v53XAU= 107 | 108 | 109 | Modules/SwiftyStoreKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule 110 | 111 | hash 112 | 113 | 3PVwCArEkkzpGwoDdEB1FKB/jVo= 114 | 115 | hash2 116 | 117 | wYRtkemsZRmomjYi1nhZcji+U1nJv6VQNlixeGXgm/c= 118 | 119 | 120 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.abi.json 121 | 122 | hash 123 | 124 | FSPnLbho3G+LL9smI3XgVOqBIQ4= 125 | 126 | hash2 127 | 128 | KnRdWE4y6t4QM5zi5JDptPdHFgJy1Tku+7GLkZS2aNM= 129 | 130 | 131 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc 132 | 133 | hash 134 | 135 | QIcVtCZcH4L/QWZoV/zrI6Za5WI= 136 | 137 | hash2 138 | 139 | LDQxXwAfZQszrBxf9nZ45k6CxiLpfWTU+DFHmIQ7BG4= 140 | 141 | 142 | Modules/SwiftyStoreKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule 143 | 144 | hash 145 | 146 | VHpqsw1oP5+jnh2iKNx89kYbDYI= 147 | 148 | hash2 149 | 150 | Oqq+yYXny8FIV1rEr95lVz4uQ20aR7Lm/2cI9wtI3gY= 151 | 152 | 153 | Modules/module.modulemap 154 | 155 | hash 156 | 157 | EVexB1o9liUvlwEH3tRMNo3AU2c= 158 | 159 | hash2 160 | 161 | D0YEqvGt6EFuEQbhVUE2tRF5UrcXApz3x3/2mnWAP2I= 162 | 163 | 164 | 165 | rules 166 | 167 | ^.* 168 | 169 | ^.*\.lproj/ 170 | 171 | optional 172 | 173 | weight 174 | 1000 175 | 176 | ^.*\.lproj/locversion.plist$ 177 | 178 | omit 179 | 180 | weight 181 | 1100 182 | 183 | ^Base\.lproj/ 184 | 185 | weight 186 | 1010 187 | 188 | ^version.plist$ 189 | 190 | 191 | rules2 192 | 193 | .*\.dSYM($|/) 194 | 195 | weight 196 | 11 197 | 198 | ^(.*/)?\.DS_Store$ 199 | 200 | omit 201 | 202 | weight 203 | 2000 204 | 205 | ^.* 206 | 207 | ^.*\.lproj/ 208 | 209 | optional 210 | 211 | weight 212 | 1000 213 | 214 | ^.*\.lproj/locversion.plist$ 215 | 216 | omit 217 | 218 | weight 219 | 1100 220 | 221 | ^Base\.lproj/ 222 | 223 | weight 224 | 1010 225 | 226 | ^Info\.plist$ 227 | 228 | omit 229 | 230 | weight 231 | 20 232 | 233 | ^PkgInfo$ 234 | 235 | omit 236 | 237 | weight 238 | 20 239 | 240 | ^embedded\.provisionprofile$ 241 | 242 | weight 243 | 20 244 | 245 | ^version\.plist$ 246 | 247 | weight 248 | 20 249 | 250 | 251 | 252 | 253 | -------------------------------------------------------------------------------- /example/iap-manager.js: -------------------------------------------------------------------------------- 1 | import IAP from 'ti.iap'; 2 | 3 | const InAppPurchaseProduct = { 4 | MY_SUBSCRIPTION_PRODUCT_ID: 'com.company.app.subscription-product', 5 | MY_CONSUMABLE_PRODUDCT_ID: 'com.company.app.consumable-product' 6 | }; 7 | 8 | let purchaseResolver; 9 | let purchaseRejecter; 10 | let selectedProduct; 11 | 12 | let isBillingInitialized = false; 13 | 14 | export default class InAppPurchaseManager { 15 | 16 | static prepare() { 17 | if (OS_ANDROID) { 18 | IAP.addEventListener('connectionUpdate', InAppPurchaseManager._onConnectionUpdate); 19 | IAP.addEventListener('purchaseUpdate', InAppPurchaseManager._onPurchaseUpdated); 20 | 21 | IAP.initialize(); 22 | } 23 | } 24 | 25 | static shutdown() { 26 | if (!OS_ANDROID) { return; } 27 | 28 | IAP.disconnect(); 29 | isBillingInitialized = false; 30 | } 31 | 32 | static get isReady() { 33 | return isBillingInitialized; 34 | } 35 | 36 | static async getProductInfos() { 37 | return new Promise(async (resolve, reject) => { 38 | if (OS_ANDROID) { 39 | try { 40 | const inAppPurchases = await InAppPurchaseManager.getAndroidProducts(IAP.SKU_TYPE_INAPP); 41 | const subscriptions = await InAppPurchaseManager.getAndroidProducts(IAP.SKU_TYPE_SUBS); 42 | 43 | resolve([...inAppPurchases, ...subscriptions]); 44 | } catch (error) { 45 | reject(error); 46 | } 47 | } else { 48 | IAP.retrieveProductsInfo({ 49 | identifiers: Object.values(InAppPurchaseProduct), 50 | callback: function (event) { 51 | if (!event.success && !event.retrievedProducts) { 52 | reject(event); 53 | } else { 54 | resolve(event.retrievedProducts); 55 | } 56 | } 57 | }); 58 | } 59 | }); 60 | } 61 | 62 | static async getAndroidProducts(productType) { 63 | return new Promise((resolve, reject) => { 64 | IAP.retrieveProductsInfo({ 65 | productType, 66 | productIdList: Object.values(InAppPurchaseProduct), 67 | callback: event => { 68 | if (!event.success) { 69 | reject(); 70 | } else { 71 | resolve(InAppPurchaseManager.mappedAndroidProductList(event.productList)); 72 | } 73 | } 74 | }); 75 | }) 76 | } 77 | 78 | static async presentCodeRedemptionSheet(code) { 79 | if (OS_ANDROID) { 80 | // Not supported natively so far 81 | } else { 82 | const { index} = await Utils.showAlert({ title: 'The code has been copied to your clipboard!' }); 83 | if (index === -1) { return; } 84 | 85 | Ti.UI.Clipboard.setText(code); 86 | IAP.presentCodeRedemptionSheet(); 87 | } 88 | } 89 | 90 | static async purchase(product) { 91 | Ti.API.warn(`** Purchasing in app product (${product.identifier}) **`); 92 | 93 | return new Promise((resolve, reject) => { 94 | if (OS_ANDROID) { 95 | if (!isBillingInitialized) { 96 | alert('Google Pay is not ready so far!'); 97 | return; 98 | } 99 | 100 | purchaseResolver = resolve; 101 | purchaseRejecter = reject; 102 | 103 | selectedProduct = product; 104 | 105 | IAP.purchase({ 106 | identifier: product.identifier, 107 | // Optional: pass subscription update parameters 108 | // oldPurchaseToken: '', 109 | // subscriptionReplacementMode: IAP.REPLACEMENT_MODE_CHARGE_FULL_PRICE, 110 | // originalExternalTransactionId: '' 111 | }); 112 | } else { 113 | IAP.purchase({ 114 | identifier: product.identifier, 115 | applicationUsername: Alloy.Models.user.get('identifier'), 116 | quantity: 1, 117 | atomically: true, 118 | callback: event => { 119 | if (!event.success) { 120 | reject(event); 121 | return; 122 | } 123 | 124 | Ti.API.warn('** Purchase successful for *' + product.identifier + ', validating purchase on server … *'); 125 | 126 | console.warn(JSON.stringify(event, null, 4)); 127 | console.warn('TODO: Post subscription to server to validate it there'); 128 | } 129 | }); 130 | } 131 | }); 132 | } 133 | 134 | // ---- Android-only events ---- 135 | 136 | static _onConnectionUpdate(event) { 137 | isBillingInitialized = event.success; 138 | } 139 | 140 | static _onPurchaseUpdated(event) { 141 | console.warn('** Purchase updated!'); 142 | console.warn(JSON.stringify(event, null, 4)); 143 | 144 | function submitSubscription() { 145 | console.warn('TODO: Post subscription to server to validate it there'); 146 | } 147 | 148 | if (!event.success) { 149 | purchaseRejecter && purchaseRejecter(event); 150 | purchaseRejecter = undefined; 151 | selectedProduct = undefined; 152 | return; 153 | } 154 | 155 | if (event.purchaseList.length === 0) { 156 | purchaseRejecter && purchaseRejecter(event); 157 | purchaseRejecter = undefined; 158 | selectedProduct = undefined; 159 | return; 160 | } 161 | 162 | const purchaseDetails = event.purchaseList[event.purchaseList.length - 1]; 163 | 164 | // Android needs to acknowledge purchases (!) 165 | if (purchaseDetails.purchaseState === IAP.PURCHASE_STATE_PURCHASED) { 166 | if (!purchaseDetails.isAcknowledged) { 167 | Ti.API.warn('** Acknowledging ' + purchaseDetails.productId + '…'); 168 | 169 | // A bit hacky way to use a different signature based on the product 170 | // TODO: Pass a flag IN_APP / SUBS to identify the correct method internally 171 | const method = [ InAppPurchaseProduct.MY_SUBSCRIPTION_PRODUCT_ID ].includes(purchaseDetails.productId) ? 'acknowledgeNonConsumableProduct' : 'acknowledgeConsumableProduct'; 172 | 173 | IAP[method]({ 174 | purchaseToken: purchaseDetails.purchaseToken, 175 | callback: purchaseResult => { 176 | Ti.API.warn('** Acknowledgement done for *' + purchaseDetails.productId + '* : ' + purchaseResult.success); 177 | // For some very rare cases, the "success" flag can be false, but the token may still be valid 178 | const success = purchaseResult.success || !!purchaseResult.purchaseToken; 179 | 180 | if (success) { 181 | Ti.API.warn('** Purchase successful for *' + purchaseDetails.productId + ', validating purchase on server … *'); 182 | submitSubscription(); 183 | } else { 184 | purchaseRejecter && purchaseRejecter(event); 185 | purchaseRejecter = undefined; 186 | selectedProduct = undefined; 187 | } 188 | } 189 | }); 190 | } else { 191 | submitSubscription(); 192 | Ti.API.warn('** Purchase acknowledged & successful for *' + purchaseDetails.productId + '*'); 193 | } 194 | } else if (purchaseDetails.purchaseState === IAP.PURCHASE_STATE_PENDING) { 195 | Ti.API.warn('** Purchase still pending! *'); 196 | Utils.showAlert({ 197 | title: L('purchase_pending'), 198 | message: L('purchase_pending_message'), 199 | buttonNames: [ L('alrighty') ] 200 | }); 201 | } 202 | } 203 | 204 | static mappedAndroidProductList(productList) { 205 | return productList.map(product => { 206 | return { 207 | localizedTitle: product.title, 208 | identifier: product.productId, 209 | localizedPrice: product.originalPrice, 210 | price: product.priceAmountMicros / 1000000, 211 | priceCurrencyCode: product.priceCurrencyCode 212 | } 213 | }); 214 | } 215 | } 216 | -------------------------------------------------------------------------------- /android/README.md: -------------------------------------------------------------------------------- 1 | # Titanium Android: Google Play Billing 2 | ### This is a detailed guide on how to leverage [Google Play's Billing Library (GPBL)](https://developer.android.com/google/play/billing) using the Titanium Android module. 3 | 4 | **[Must read for server handling before using this module](https://developer.android.com/google/play/billing/security#verify)** 5 | 6 | #### Version details: 7 | - Google Play Billing Library: 3.0.0 8 | - Titanium SDK: 9.0.0.GA+ 9 | 10 | #### Grab the module: 11 | ```js 12 | const IAP = require('ti.iap'); 13 | ``` 14 | 15 | #### Initialization: 16 | Before calling any method on module, make sure to call `initialize()` which will respond through an event `connectionUpdate` to report whether the GPBL is connected for further actions: 17 | 18 | ```js 19 | let isBillingInitialized = false; 20 | 21 | IAP.addEventListener('connectionUpdate', function (e) { 22 | isBillingInitialized = e.success; 23 | }); 24 | 25 | IAP.initialize(); 26 | ``` 27 | 28 | #### Module Constants for different purposes: 29 | ```js 30 | /* Check for supported features in `isFeatureSupported(…)` method */ 31 | FEATURE_TYPE_IN_APP_ITEMS_ON_VR // Purchase/query for in-app items on VR 32 | FEATURE_TYPE_PRICE_CHANGE_CONFIRMATION // Launch a price change confirmation flow 33 | FEATURE_TYPE_SUBSCRIPTIONS // Purchase/query for subscriptions 34 | FEATURE_TYPE_SUBSCRIPTIONS_ON_VR // Purchase/query for subscriptions on VR 35 | FEATURE_TYPE_SUBSCRIPTIONS_UPDATE // Subscriptions update/replace 36 | 37 | /* product type constants */ 38 | SKU_TYPE_INAPP // for in-app consumable or non-consumable products 39 | SKU_TYPE_SUBS // for subscriptions 40 | 41 | /* purchase states to check after purchasing a product */ 42 | PURCHASE_STATE_UNSPECIFIED_STATE // when the purchase state cannot be determined 43 | PURCHASE_STATE_PURCHASED // when the product is purchased, acknowledgement is remaining after this generally 44 | PURCHASE_STATE_PENDING // when purchase payment is pending after the product is owned, the payment can be made outside the app or can be cancelled as well 45 | 46 | /* response codes to match for `code` parameter returned in callbacks */ 47 | CODE_BILLING_UNAVAILABLE // "Billing API version is not supported for the type requested." 48 | CODE_DEVELOPER_ERROR // "Invalid arguments provided to the API." 49 | CODE_FEATURE_NOT_SUPPORTED // "Requested feature is not supported by Play Store on the current device." 50 | CODE_ITEM_ALREADY_OWNED // "Failure to purchase since item is already owned." 51 | CODE_ITEM_NOT_OWNED // "Failure to consume since item is not owned." 52 | CODE_ITEM_UNAVAILABLE // "Requested product is not available for purchase." 53 | CODE_SERVICE_DISCONNECTED // "Play Store service is not connected now - potentially transient state." 54 | CODE_SERVICE_TIMEOUT // "The request has reached the maximum timeout before Google Play responds." 55 | CODE_SERVICE_UNAVAILABLE // "Network connection is down." 56 | CODE_USER_CANCELED // "User pressed back or canceled dialog." 57 | CODE_ERROR // "Fatal error during the API action." 58 | CODE_OK // when the response was `ok` 59 | CODE_BILLING_NOT_READY // "Billing library not ready" 60 | CODE_SKU_NOT_AVAILABLE // "SKU details not available for making purchase" 61 | ``` 62 | 63 | #### Check whether the GPBL is finally ready to make purchases and other calls 64 | ```js 65 | // this method also tells whether the in-app purchases are supported and ready to make purchases 66 | // or to know the statuses of past purchases 67 | const isBillingReady = IAP.isReady(); 68 | ``` 69 | Note: Some Android devices might have an older version of the Google Play Store app that doesn't support certain products types, such as subscriptions. Before your app enters the billing flow, you can call isFeatureSupported() to determine whether the device supports the products you want to sell: 70 | ```js 71 | const isFeatureSupported = IAP.isFeatureSupported(IAP.FEATURE_TYPE_SUBSCRIPTIONS); 72 | ``` 73 | 74 | ### Get products information 75 | Before making a purchase on a product, it's important to retrieve its details as the module will internally store its required model. 76 | 77 | ``` 78 | IAP.retrieveProductsInfo(options); 79 | 80 | /* 81 | options: dictionary of below parameters 82 | - `productType`: pass product type constant - either IAP.SKU_TYPE_INAPP or IAP.SKU_TYPE_SUBS 83 | - `productIdList`: pass array of product ids setup at Google Play console for the app 84 | - `callback`: callback method after successful retrieval, contains below parameters 85 | - `success`: boolean for successful response 86 | - `code`: response code - IAP.CODE_OK for success 87 | - `productList`: array of product information dictionary with following key-value pairs 88 | { 89 | "originalPrice": "$1.50", 90 | "productId": "test_id_0001", 91 | "description": "Testing Product", 92 | "originalPriceAmountMicros": 1500000, 93 | "title": "Test title", 94 | "type": "inapp", 95 | "freeTrialPeriod": "", 96 | "introductoryPrice": "", 97 | "priceCurrencyCode": "USD", 98 | "introductoryPricePeriod": "", 99 | "subscriptionPeriod": "", 100 | "priceAmountMicros": 1500000, 101 | "price": "$1.50", 102 | "introductoryPriceAmountMicros": 0, 103 | "iconUrl": "", 104 | "introductoryPriceCycles": 0 105 | } 106 | 107 | */ 108 | ``` 109 | 110 | 111 | ### Make purchase 112 | 113 | Calling purchase method will launch the purchase dialog with relevant product information. Pass product-id and make sure to fetch product information before making a purchase call. 114 | ```js 115 | const purchaseDialogLaunchCode = IAP.purchase(PRODUCT_ID); 116 | 117 | // handle further if launch-code is not ok 118 | if (purchaseDialogLaunchCode != IAP.CODE_OK) { 119 | // check response codes in constants section for relevant messages 120 | } 121 | ``` 122 | 123 | 124 | ### Get purchase status: 125 | **Purchase statuses are handled in different ways as users can make payments outside or inside the app, on any other devices, even after launching purchase dialog on one device, or even if the app is killed. This section will guide on how to handle different purchase states.** 126 | 127 | 1. The event listener `purchaseUpdate` can be used to know the purchase details in following cases: 128 | - purchase is made or cancelled inside the app. 129 | - purchase is made outside with the app running in background mode. (event is not fired if purchase is not made in this mode) 130 | 131 | ```js 132 | // register this listener before making purchases 133 | IAP.addEventListener('purchaseUpdate', function (e) { 134 | /* 135 | { 136 | "success": true, 137 | "code": 0, 138 | "purchaseList": [ 139 | { 140 | "purchaseToken": "xxxxxxxxxxx", 141 | "productId": "test_0001", 142 | "orderId": "GPA.1234-1234-1234-1234", 143 | "signature": "xxxxxxxx", 144 | "obfuscatedAccountId": "", 145 | "developerPayload": "", 146 | "isAutoRenewing": false, 147 | "isAcknowledged": false, 148 | "purchaseTime": 1599226070820, 149 | "packageName": "com.test.app", 150 | "obfuscatedProfileId": "", 151 | "purchaseState": 2 152 | }, 153 | … 154 | ] 155 | } 156 | */ 157 | 158 | if (e.success) { 159 | // e.purchaseList contains the purchase data represented above 160 | // check the purchase state and acknowledge product to finally give it to user; 161 | acknowledgePurchase(e.purchaseList[0]); 162 | } else { 163 | alert(e.code); 164 | } 165 | }); 166 | 167 | ``` 168 | 169 | 2. Use `queryPurchases` method every time the app is launched to know the status of any purchase made outside the app or in killed state. [Read more about this method here](https://developer.android.com/reference/com/android/billingclient/api/BillingClient#querypurchases) 170 | 171 | ```js 172 | const e = IAP.queryPurchases({ 173 | productType: IAP.SKU_TYPE_INAPP, 174 | // the response parameters are exactly same as in event listener `purchaseUpdate` 175 | callback: event => processQueriedPurchaseResponse(event) 176 | }); 177 | 178 | function processQueriedPurchaseResponse(e) { 179 | if (e.success) { 180 | if (e.purchaseList.length > 0) { 181 | for (purchaseDetails of e.purchaseList) { 182 | acknowledgePurchase(purchaseDetails); 183 | } 184 | } 185 | } else { 186 | alert(e.code); 187 | } 188 | } 189 | ``` 190 | 191 | ### Acknowledge purchase 192 | Once the purchase is made, it's mandatory to acknowledge it so Google Play can mark it as claimed. [Read more about acknowledging here](https://developer.android.com/google/play/billing/integrate#process) 193 | 194 | - If the product was consumable, call `acknowledgeConsumableProduct()` 195 | - If the product was non-consumable, call `acknowledgeNonConsumableProduct()` 196 | ```js 197 | function acknowledgePurchase(purchaseDetails) { 198 | if (purchaseDetails.purchaseState === IAP.PURCHASE_STATE_PURCHASED) { 199 | if (!purchaseDetails.isAcknowledged) { 200 | // use `acknowledgeNonConsumableProduct` method if item is non-consumable 201 | IAP.acknowledgeConsumableProduct({ 202 | purchaseToken: purchaseDetails.purchaseToken, 203 | callback: function (e) { 204 | e.success ? alert('purchase was successful and product delivered to user') : alert(e.code); 205 | } 206 | }); 207 | } else { 208 | // do not deliver the product until the purchase is acknowledged 209 | } 210 | } else if (purchaseDetails.purchaseState === IAP.PURCHASE_STATE_PENDING) { 211 | // purchase is still pending, it can happen if user wants to make purchase outside the app or by any other medium 212 | } 213 | } 214 | ``` 215 | 216 | 217 | ### Additional methods 218 | - **queryPurchaseHistoryAsync** : to know the purchase details of successful purchases from Google server 219 | 220 | ```js 221 | IAP.queryPurchaseHistoryAsync({ 222 | productType: IAP.SKU_TYPE_INAPP, 223 | callback: processQueriedPurchaseResponse // implementation in `queryPurchases` section 224 | }); 225 | ``` 226 | 227 | - **disconnect** : method to call when entire billing flow is done to release resources 228 | ```js 229 | IAP.disconnect(); 230 | ``` 231 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/ios-arm64/SwiftyStoreKit.framework/Headers/SwiftyStoreKit-Swift.h: -------------------------------------------------------------------------------- 1 | #if 0 2 | #elif defined(__arm64__) && __arm64__ 3 | // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) 4 | #ifndef SWIFTYSTOREKIT_SWIFT_H 5 | #define SWIFTYSTOREKIT_SWIFT_H 6 | #pragma clang diagnostic push 7 | #pragma clang diagnostic ignored "-Wgcc-compat" 8 | 9 | #if !defined(__has_include) 10 | # define __has_include(x) 0 11 | #endif 12 | #if !defined(__has_attribute) 13 | # define __has_attribute(x) 0 14 | #endif 15 | #if !defined(__has_feature) 16 | # define __has_feature(x) 0 17 | #endif 18 | #if !defined(__has_warning) 19 | # define __has_warning(x) 0 20 | #endif 21 | 22 | #if __has_include() 23 | # include 24 | #endif 25 | 26 | #pragma clang diagnostic ignored "-Wduplicate-method-match" 27 | #pragma clang diagnostic ignored "-Wauto-import" 28 | #if defined(__OBJC__) 29 | #include 30 | #endif 31 | #if defined(__cplusplus) 32 | #include 33 | #include 34 | #include 35 | #else 36 | #include 37 | #include 38 | #include 39 | #endif 40 | 41 | #if !defined(SWIFT_TYPEDEFS) 42 | # define SWIFT_TYPEDEFS 1 43 | # if __has_include() 44 | # include 45 | # elif !defined(__cplusplus) 46 | typedef uint_least16_t char16_t; 47 | typedef uint_least32_t char32_t; 48 | # endif 49 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 50 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 51 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 52 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 53 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 54 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 55 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 56 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 57 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 58 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 59 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 60 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 61 | #endif 62 | 63 | #if !defined(SWIFT_PASTE) 64 | # define SWIFT_PASTE_HELPER(x, y) x##y 65 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 66 | #endif 67 | #if !defined(SWIFT_METATYPE) 68 | # define SWIFT_METATYPE(X) Class 69 | #endif 70 | #if !defined(SWIFT_CLASS_PROPERTY) 71 | # if __has_feature(objc_class_property) 72 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 73 | # else 74 | # define SWIFT_CLASS_PROPERTY(...) 75 | # endif 76 | #endif 77 | 78 | #if __has_attribute(objc_runtime_name) 79 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 80 | #else 81 | # define SWIFT_RUNTIME_NAME(X) 82 | #endif 83 | #if __has_attribute(swift_name) 84 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 85 | #else 86 | # define SWIFT_COMPILE_NAME(X) 87 | #endif 88 | #if __has_attribute(objc_method_family) 89 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 90 | #else 91 | # define SWIFT_METHOD_FAMILY(X) 92 | #endif 93 | #if __has_attribute(noescape) 94 | # define SWIFT_NOESCAPE __attribute__((noescape)) 95 | #else 96 | # define SWIFT_NOESCAPE 97 | #endif 98 | #if __has_attribute(ns_consumed) 99 | # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) 100 | #else 101 | # define SWIFT_RELEASES_ARGUMENT 102 | #endif 103 | #if __has_attribute(warn_unused_result) 104 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 105 | #else 106 | # define SWIFT_WARN_UNUSED_RESULT 107 | #endif 108 | #if __has_attribute(noreturn) 109 | # define SWIFT_NORETURN __attribute__((noreturn)) 110 | #else 111 | # define SWIFT_NORETURN 112 | #endif 113 | #if !defined(SWIFT_CLASS_EXTRA) 114 | # define SWIFT_CLASS_EXTRA 115 | #endif 116 | #if !defined(SWIFT_PROTOCOL_EXTRA) 117 | # define SWIFT_PROTOCOL_EXTRA 118 | #endif 119 | #if !defined(SWIFT_ENUM_EXTRA) 120 | # define SWIFT_ENUM_EXTRA 121 | #endif 122 | #if !defined(SWIFT_CLASS) 123 | # if __has_attribute(objc_subclassing_restricted) 124 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 125 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 126 | # else 127 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 128 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 129 | # endif 130 | #endif 131 | #if !defined(SWIFT_RESILIENT_CLASS) 132 | # if __has_attribute(objc_class_stub) 133 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) 134 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) 135 | # else 136 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) 137 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) 138 | # endif 139 | #endif 140 | 141 | #if !defined(SWIFT_PROTOCOL) 142 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 143 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 144 | #endif 145 | 146 | #if !defined(SWIFT_EXTENSION) 147 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 148 | #endif 149 | 150 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 151 | # if __has_attribute(objc_designated_initializer) 152 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 153 | # else 154 | # define OBJC_DESIGNATED_INITIALIZER 155 | # endif 156 | #endif 157 | #if !defined(SWIFT_ENUM_ATTR) 158 | # if defined(__has_attribute) && __has_attribute(enum_extensibility) 159 | # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) 160 | # else 161 | # define SWIFT_ENUM_ATTR(_extensibility) 162 | # endif 163 | #endif 164 | #if !defined(SWIFT_ENUM) 165 | # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 166 | # if __has_feature(generalized_swift_name) 167 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 168 | # else 169 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) 170 | # endif 171 | #endif 172 | #if !defined(SWIFT_UNAVAILABLE) 173 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 174 | #endif 175 | #if !defined(SWIFT_UNAVAILABLE_MSG) 176 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 177 | #endif 178 | #if !defined(SWIFT_AVAILABILITY) 179 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 180 | #endif 181 | #if !defined(SWIFT_WEAK_IMPORT) 182 | # define SWIFT_WEAK_IMPORT __attribute__((weak_import)) 183 | #endif 184 | #if !defined(SWIFT_DEPRECATED) 185 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 186 | #endif 187 | #if !defined(SWIFT_DEPRECATED_MSG) 188 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 189 | #endif 190 | #if __has_feature(attribute_diagnose_if_objc) 191 | # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) 192 | #else 193 | # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) 194 | #endif 195 | #if defined(__OBJC__) 196 | #if !defined(IBSegueAction) 197 | # define IBSegueAction 198 | #endif 199 | #endif 200 | #if !defined(SWIFT_EXTERN) 201 | # if defined(__cplusplus) 202 | # define SWIFT_EXTERN extern "C" 203 | # else 204 | # define SWIFT_EXTERN extern 205 | # endif 206 | #endif 207 | #if !defined(SWIFT_CALL) 208 | # define SWIFT_CALL __attribute__((swiftcall)) 209 | #endif 210 | #if defined(__cplusplus) 211 | #if !defined(SWIFT_NOEXCEPT) 212 | # define SWIFT_NOEXCEPT noexcept 213 | #endif 214 | #else 215 | #if !defined(SWIFT_NOEXCEPT) 216 | # define SWIFT_NOEXCEPT 217 | #endif 218 | #endif 219 | #if defined(__cplusplus) 220 | #if !defined(SWIFT_CXX_INT_DEFINED) 221 | #define SWIFT_CXX_INT_DEFINED 222 | namespace swift { 223 | using Int = ptrdiff_t; 224 | using UInt = size_t; 225 | } 226 | #endif 227 | #endif 228 | #if defined(__OBJC__) 229 | #if __has_feature(modules) 230 | #if __has_warning("-Watimport-in-framework-header") 231 | #pragma clang diagnostic ignored "-Watimport-in-framework-header" 232 | #endif 233 | @import Foundation; 234 | @import ObjectiveC; 235 | @import StoreKit; 236 | #endif 237 | 238 | #endif 239 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 240 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 241 | #if __has_warning("-Wpragma-clang-attribute") 242 | # pragma clang diagnostic ignored "-Wpragma-clang-attribute" 243 | #endif 244 | #pragma clang diagnostic ignored "-Wunknown-pragmas" 245 | #pragma clang diagnostic ignored "-Wnullability" 246 | #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" 247 | 248 | #if __has_attribute(external_source_symbol) 249 | # pragma push_macro("any") 250 | # undef any 251 | # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SwiftyStoreKit",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) 252 | # pragma pop_macro("any") 253 | #endif 254 | 255 | #if defined(__OBJC__) 256 | @class SKProductsRequest; 257 | @class SKProductsResponse; 258 | @class SKRequest; 259 | 260 | SWIFT_CLASS("_TtC14SwiftyStoreKit24InAppProductQueryRequest") 261 | @interface InAppProductQueryRequest : NSObject 262 | - (void)productsRequest:(SKProductsRequest * _Nonnull)request didReceiveResponse:(SKProductsResponse * _Nonnull)response; 263 | - (void)requestDidFinish:(SKRequest * _Nonnull)request; 264 | - (void)request:(SKRequest * _Nonnull)request didFailWithError:(NSError * _Nonnull)error; 265 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 266 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 267 | @end 268 | 269 | 270 | SWIFT_CLASS("_TtC14SwiftyStoreKit26InAppReceiptRefreshRequest") 271 | @interface InAppReceiptRefreshRequest : NSObject 272 | - (void)requestDidFinish:(SKRequest * _Nonnull)request; 273 | - (void)request:(SKRequest * _Nonnull)request didFailWithError:(NSError * _Nonnull)error; 274 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 275 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 276 | @end 277 | 278 | 279 | SWIFT_CLASS("_TtC14SwiftyStoreKit23InAppReceiptVerificator") 280 | @interface InAppReceiptVerificator : NSObject 281 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 282 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 283 | @end 284 | 285 | @class SKPaymentQueue; 286 | @class SKPaymentTransaction; 287 | @class NSString; 288 | @class SKDownload; 289 | @class SKPayment; 290 | @class SKProduct; 291 | 292 | SWIFT_CLASS("_TtC14SwiftyStoreKit22PaymentQueueController") 293 | @interface PaymentQueueController : NSObject 294 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue updatedTransactions:(NSArray * _Nonnull)transactions; 295 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue didRevokeEntitlementsForProductIdentifiers:(NSArray * _Nonnull)productIdentifiers; 296 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue removedTransactions:(NSArray * _Nonnull)transactions; 297 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue restoreCompletedTransactionsFailedWithError:(NSError * _Nonnull)error; 298 | - (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue * _Nonnull)queue; 299 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue updatedDownloads:(NSArray * _Nonnull)downloads; 300 | - (BOOL)paymentQueue:(SKPaymentQueue * _Nonnull)queue shouldAddStorePayment:(SKPayment * _Nonnull)payment forProduct:(SKProduct * _Nonnull)product SWIFT_WARN_UNUSED_RESULT; 301 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 302 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 303 | @end 304 | 305 | 306 | SWIFT_CLASS("_TtC14SwiftyStoreKit22ProductsInfoController") 307 | @interface ProductsInfoController : NSObject 308 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 309 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 310 | @end 311 | 312 | 313 | 314 | 315 | @interface SKPaymentTransaction (SWIFT_EXTENSION(SwiftyStoreKit)) 316 | @property (nonatomic, readonly, copy) NSString * _Nonnull debugDescription; 317 | @end 318 | 319 | 320 | 321 | #endif 322 | #if defined(__cplusplus) 323 | #endif 324 | #if __has_attribute(external_source_symbol) 325 | # pragma clang attribute pop 326 | #endif 327 | #pragma clang diagnostic pop 328 | #endif 329 | 330 | #else 331 | #error unsupported Swift architecture 332 | #endif 333 | -------------------------------------------------------------------------------- /android/src/ti/iap/TitaniumInAppPurchaseModule.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * This file was auto-generated by the Titanium Module SDK helper for Android 3 | * Appcelerator Titanium Mobile 4 | * Copyright (c) 2009-2018 by Appcelerator, Inc. All Rights Reserved. 5 | * Licensed under the terms of the Apache Public License 6 | * Please see the LICENSE included with this distribution for details. 7 | * 8 | */ 9 | @file:Suppress("unused", "SpellCheckingInspection") 10 | 11 | package ti.iap 12 | 13 | import com.android.billingclient.api.* 14 | import com.android.billingclient.api.BillingClient.BillingResponseCode.* 15 | import com.android.billingclient.api.BillingClient.FeatureType.* 16 | import com.android.billingclient.api.BillingClient.SkuType.INAPP 17 | import com.android.billingclient.api.BillingClient.SkuType.SUBS 18 | import com.android.billingclient.api.BillingFlowParams.SubscriptionUpdateParams 19 | import com.android.billingclient.api.BillingFlowParams.SubscriptionUpdateParams.ReplacementMode 20 | import com.android.billingclient.api.Purchase.PurchaseState.* 21 | import org.appcelerator.kroll.KrollDict 22 | import org.appcelerator.kroll.KrollFunction 23 | import org.appcelerator.kroll.common.Log 24 | import org.appcelerator.kroll.KrollModule 25 | import org.appcelerator.kroll.KrollProxy 26 | import org.appcelerator.kroll.annotations.Kroll 27 | import org.appcelerator.titanium.TiApplication 28 | import ti.iap.handlers.BillingConnectionHandler 29 | import ti.iap.handlers.ProductsHandler 30 | import ti.iap.handlers.PurchaseHandler 31 | import ti.iap.helper.QueryHandler 32 | import ti.iap.models.PurchaseModel 33 | 34 | 35 | @Kroll.module(name = "TitaniumInAppPurchase", id = "ti.iap") 36 | class TitaniumInAppPurchaseModule : KrollModule() { 37 | private var purchaseHandler: PurchaseHandler? = null 38 | private var billingConnectionState: BillingConnectionHandler? = null 39 | private var billingClient: BillingClient? = null 40 | 41 | companion object { 42 | const val LCAT = "TitaniumIAP" 43 | 44 | @Kroll.constant const val FEATURE_TYPE_IN_APP_ITEMS_ON_VR = -1 // Purchase/query for in-app items on VR (removed in v5) 45 | @Kroll.constant const val FEATURE_TYPE_PRICE_CHANGE_CONFIRMATION = PRICE_CHANGE_CONFIRMATION // Launch a price change confirmation flow 46 | @Kroll.constant const val FEATURE_TYPE_SUBSCRIPTIONS = SUBSCRIPTIONS // Purchase/query for subscriptions 47 | @Kroll.constant const val FEATURE_TYPE_SUBSCRIPTIONS_ON_VR = -2 // Purchase/query for subscriptions on VR (removed in v5) 48 | @Kroll.constant const val FEATURE_TYPE_SUBSCRIPTIONS_UPDATE = SUBSCRIPTIONS_UPDATE // Subscriptions update/replace 49 | 50 | @Kroll.constant const val SKU_TYPE_INAPP = INAPP 51 | @Kroll.constant const val SKU_TYPE_SUBS = SUBS 52 | 53 | @Kroll.constant const val PURCHASE_STATE_UNSPECIFIED_STATE = UNSPECIFIED_STATE 54 | @Kroll.constant const val PURCHASE_STATE_PURCHASED = PURCHASED 55 | @Kroll.constant const val PURCHASE_STATE_PENDING = PENDING 56 | 57 | @Kroll.constant const val CODE_BILLING_UNAVAILABLE = BILLING_UNAVAILABLE // "Billing API version is not supported for the type requested." 58 | @Kroll.constant const val CODE_DEVELOPER_ERROR = DEVELOPER_ERROR // "Invalid arguments provided to the API." 59 | @Kroll.constant const val CODE_FEATURE_NOT_SUPPORTED = FEATURE_NOT_SUPPORTED // "Requested feature is not supported by Play Store on the current device." 60 | @Kroll.constant const val CODE_ITEM_ALREADY_OWNED = ITEM_ALREADY_OWNED // "Failure to purchase since item is already owned." 61 | @Kroll.constant const val CODE_ITEM_NOT_OWNED = ITEM_NOT_OWNED // "Failure to consume since item is not owned." 62 | @Kroll.constant const val CODE_ITEM_UNAVAILABLE = ITEM_UNAVAILABLE // "Requested product is not available for purchase." 63 | @Kroll.constant const val CODE_SERVICE_DISCONNECTED = SERVICE_DISCONNECTED // "Play Store service is not connected now - potentially transient state." 64 | @Kroll.constant const val CODE_SERVICE_UNAVAILABLE = SERVICE_UNAVAILABLE // "Network connection is down." 65 | @Kroll.constant const val CODE_NETWORK_ERROR = NETWORK_ERROR // "Network connection is down." 66 | @Kroll.constant const val CODE_USER_CANCELED = USER_CANCELED // "User pressed back or canceled dialog." 67 | @Kroll.constant const val CODE_ERROR = ERROR // "Fatal error during the API action." 68 | @Kroll.constant const val CODE_OK = OK 69 | @Kroll.constant const val CODE_BILLING_NOT_READY = 100 // "Billing library not ready" 70 | @Kroll.constant const val CODE_SKU_NOT_AVAILABLE = 101 // "SKU details not available for making purchase" 71 | 72 | @Kroll.constant const val REPLACEMENT_MODE_CHARGE_FULL_PRICE = ReplacementMode.CHARGE_FULL_PRICE 73 | @Kroll.constant const val REPLACEMENT_MODE_UNKNOWN_REPLACEMENT_MODE = ReplacementMode.UNKNOWN_REPLACEMENT_MODE 74 | @Kroll.constant const val REPLACEMENT_MODE_CHARGE_PRORATED_PRICE = ReplacementMode.CHARGE_PRORATED_PRICE 75 | @Kroll.constant const val REPLACEMENT_MODE_WITHOUT_PRORATION = ReplacementMode.WITHOUT_PRORATION 76 | @Kroll.constant const val REPLACEMENT_MODE_WITH_TIME_PRORATION = ReplacementMode.WITH_TIME_PRORATION 77 | @Kroll.constant const val REPLACEMENT_MODE_DEFERRED = ReplacementMode.DEFERRED 78 | } 79 | 80 | @Kroll.method 81 | fun initialize() { 82 | if (purchaseHandler == null) { 83 | purchaseHandler = PurchaseHandler(this as KrollProxy) 84 | } 85 | 86 | if (billingConnectionState == null) { 87 | billingConnectionState = BillingConnectionHandler(this as KrollProxy) 88 | } 89 | 90 | if (billingClient == null) { 91 | billingClient = BillingClient.newBuilder(TiApplication.getInstance()) 92 | .setListener(purchaseHandler as PurchasesUpdatedListener) 93 | .enablePendingPurchases() 94 | .build() 95 | } 96 | 97 | billingClient?.startConnection(billingConnectionState as BillingClientStateListener) 98 | } 99 | 100 | @Kroll.method 101 | fun getConnectionState(): Int? { 102 | billingClient?.let { 103 | return it.connectionState 104 | } ?: return null 105 | } 106 | 107 | @Kroll.method 108 | fun disconnect() { 109 | billingClient?.endConnection() 110 | billingClient = null 111 | } 112 | 113 | @Kroll.method 114 | fun isReady(): Boolean { 115 | return billingConnectionState?.isConnected == true && billingClient?.isReady == true 116 | } 117 | 118 | @Kroll.method 119 | fun isFeatureSupported(feature: String): Boolean { 120 | return isReady() && billingClient!!.isFeatureSupported(feature).responseCode == OK 121 | } 122 | 123 | @Kroll.method 124 | fun launchPriceChangeConfirmationFlow(args: KrollDict) { 125 | Log.e("Ti.IAP", "The \"launchPriceChangeConfirmationFlow\" method was removed in In App Billing v6. Use the properties \"oldPurchaseToken\", \"subscriptionReplacementMode\" and \"originalExternalTransactionId\" in \"purchase()\" instead!") 126 | } 127 | 128 | private fun isBillingLibraryReady(args: KrollDict? = null): Boolean { 129 | if (!isReady()) { 130 | if (args?.containsKeyAndNotNull(IAPConstants.Properties.CALLBACK) == true) { 131 | val event = KrollDict() 132 | event[IAPConstants.Properties.SUCCESS] = false 133 | event[IAPConstants.Properties.CODE] = CODE_BILLING_NOT_READY 134 | 135 | val callback = args[IAPConstants.Properties.CALLBACK] as KrollFunction? 136 | callback?.callAsync(getKrollObject(), event) 137 | } 138 | 139 | return false 140 | } 141 | 142 | return true 143 | } 144 | 145 | @Kroll.method 146 | fun fetchLocalProductList(): Array { 147 | val productList = ArrayList() 148 | 149 | for (skuModel in ProductsHandler.skuList) { 150 | productList.add(skuModel.modelData) 151 | } 152 | 153 | return productList.toTypedArray() 154 | } 155 | 156 | @Kroll.method 157 | fun fetchLocalPurchaseList(): Array { 158 | val purchaseList = ArrayList() 159 | 160 | for (purchaseModel in PurchaseHandler.purchaseCatalog) { 161 | purchaseList.add(purchaseModel.modelData) 162 | } 163 | 164 | return purchaseList.toTypedArray() 165 | } 166 | 167 | @Kroll.method 168 | fun retrieveProductsInfo(args: KrollDict) { 169 | if (isBillingLibraryReady(args)) { 170 | QueryHandler.fetchProductsInfo(billingClient!!, args, getKrollObject()) 171 | } 172 | } 173 | 174 | @Kroll.method 175 | fun purchase(params: KrollDict): Int { 176 | if (!isBillingLibraryReady()) { 177 | return CODE_BILLING_NOT_READY 178 | } 179 | 180 | val productId = params.getString("identifier") 181 | val oldPurchaseToken = params.optString("oldPurchaseToken", null) 182 | val subscriptionReplacementMode = params.optInt("subscriptionReplacementMode", -1) 183 | val originalExternalTransactionId = params.optString("originalExternalTransactionId", null) 184 | 185 | val skuDetails = ProductsHandler.getSkuDetails(productId) ?: return CODE_SKU_NOT_AVAILABLE 186 | var flowParams = BillingFlowParams.newBuilder().setSkuDetails(skuDetails) 187 | 188 | // Handle subscription updates 189 | if (oldPurchaseToken != null) { 190 | var params = SubscriptionUpdateParams.newBuilder().setOldPurchaseToken(oldPurchaseToken) 191 | 192 | if (subscriptionReplacementMode != -1) { 193 | params = params.setSubscriptionReplacementMode(subscriptionReplacementMode); 194 | } 195 | 196 | if (originalExternalTransactionId != null) { 197 | params = params.setOriginalExternalTransactionId(originalExternalTransactionId); 198 | } 199 | 200 | flowParams = flowParams.setSubscriptionUpdateParams(params.build()) 201 | } 202 | 203 | val launchBillingResult = billingClient!!.launchBillingFlow(TiApplication.getAppCurrentActivity(), flowParams.build()) 204 | 205 | return launchBillingResult.responseCode 206 | } 207 | 208 | @Kroll.method 209 | fun acknowledgeConsumableProduct(args: KrollDict) { 210 | if (isBillingLibraryReady(args)) { 211 | QueryHandler.acknowledgeConsumableProduct(billingClient!!, args, getKrollObject()) 212 | } 213 | } 214 | 215 | @Kroll.method 216 | fun acknowledgeNonConsumableProduct(args: KrollDict) { 217 | if (isBillingLibraryReady(args)) { 218 | QueryHandler.acknowledgeNonConsumableProduct(billingClient!!, args, getKrollObject()) 219 | } 220 | } 221 | 222 | @Kroll.method 223 | fun queryPurchases(args: KrollDict) { 224 | val callback = args["callback"] as KrollFunction 225 | val purchaseList = ArrayList() 226 | val resultDict = KrollDict() 227 | resultDict[IAPConstants.Properties.SUCCESS] = false 228 | resultDict[IAPConstants.Properties.CODE] = CODE_BILLING_NOT_READY 229 | 230 | if (isReady()) { 231 | resultDict[IAPConstants.Properties.SUCCESS] = true 232 | resultDict[IAPConstants.Properties.CODE] = OK 233 | 234 | val productType = args.optString(IAPConstants.Properties.PRODUCT_TYPE, SKU_TYPE_INAPP) 235 | val params = QueryPurchasesParams.newBuilder().setProductType(productType).build() 236 | 237 | billingClient?.queryPurchasesAsync(params) { billingResult, purchasesList -> 238 | val event = KrollDict() 239 | if (billingResult.responseCode == OK) { 240 | if (purchasesList.isNotEmpty()) { 241 | for (purchase in purchasesList) { 242 | purchaseList.add(PurchaseModel(purchase).modelData) 243 | } 244 | } 245 | event["purchaseList"] = purchaseList.toTypedArray() 246 | event["code"] = billingResult.responseCode 247 | event["success"] = billingResult.responseCode == OK 248 | } 249 | callback.callAsync(getKrollObject(), event) 250 | } 251 | } 252 | } 253 | 254 | @Kroll.method 255 | fun queryPurchasesAsync(args: KrollDict) { 256 | Log.e("Ti.IAP", "The \"queryPurchasesAsync\" API has been removed. Use \"queryPurchases\" instead!") 257 | } 258 | 259 | @Kroll.method 260 | fun showInAppMessages(callback: KrollFunction) { 261 | val params = InAppMessageParams.newBuilder().build() 262 | billingClient?.showInAppMessages(TiApplication.getAppCurrentActivity(), params) { inAppMessageResult -> 263 | val event = KrollDict() 264 | event["code"] = inAppMessageResult.responseCode 265 | if (inAppMessageResult.responseCode == InAppMessageResult.InAppMessageResponseCode.NO_ACTION_NEEDED) { 266 | // The flow has finished and there is no action needed from developers. 267 | } else if (inAppMessageResult.responseCode == InAppMessageResult.InAppMessageResponseCode.SUBSCRIPTION_STATUS_UPDATED) { 268 | event["purchaseToken"] = inAppMessageResult.purchaseToken 269 | } 270 | callback.callAsync(getKrollObject(), event) 271 | } 272 | } 273 | 274 | @Kroll.method 275 | fun queryPurchaseHistoryAsync(args: KrollDict) { 276 | if (isBillingLibraryReady(args)) { 277 | QueryHandler.queryPurchaseHistoryAsync(billingClient!!, args, getKrollObject()) 278 | } 279 | } 280 | } -------------------------------------------------------------------------------- /ios/Classes/TiIapModule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TiIapModule.swift 3 | // titanium-in-app-purchase 4 | // 5 | // Created by Hans Knöchel 6 | // Copyright (c) 2020 Hans Knöchel. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import TitaniumKit 11 | import StoreKit 12 | import SwiftyStoreKit 13 | 14 | @objc(TiIapModule) 15 | class TiIapModule: TiModule { 16 | 17 | // MARK: Constants 18 | 19 | @available(iOS 11.2, *) 20 | @objc func SUBSCRIPTION_PERIOD_UNIT_DAY() -> UInt { 21 | return SKProduct.PeriodUnit.day.rawValue 22 | } 23 | 24 | @available(iOS 11.2, *) 25 | @objc func SUBSCRIPTION_PERIOD_UNIT_WEEK() -> UInt { 26 | return SKProduct.PeriodUnit.week.rawValue 27 | } 28 | 29 | @available(iOS 11.2, *) 30 | @objc func SUBSCRIPTION_PERIOD_UNIT_MONTH() -> UInt { 31 | return SKProduct.PeriodUnit.month.rawValue 32 | } 33 | 34 | @available(iOS 11.2, *) 35 | @objc func SUBSCRIPTION_PERIOD_UNIT_YEAR() -> UInt { 36 | return SKProduct.PeriodUnit.year.rawValue 37 | } 38 | 39 | @objc let SUBSCRIPTION_TYPE_AUTO_RENEWABLE = 0 40 | 41 | @objc let SUBSCRIPTION_TYPE_NON_RENEWING = 1 42 | 43 | // MARK: Proxy helpers 44 | 45 | func moduleGUID() -> String { 46 | return "8420a03d-cae0-48a0-92e5-e9ad9cda4c86" 47 | } 48 | 49 | override func moduleId() -> String! { 50 | return "ti.iap" 51 | } 52 | 53 | // MARK: Public methods 54 | 55 | @objc(initialize:) 56 | func initialize(unused: [Any]?) { 57 | // NO-OP (for Android compatibility) 58 | } 59 | 60 | @objc(completeTransactions:) 61 | func completeTransactions(arguments: [Any]?) { 62 | guard let arguments = arguments else { fatalError() } 63 | 64 | let callback = arguments[0] as? KrollCallback 65 | 66 | SwiftyStoreKit.completeTransactions(atomically: true) { purchases in 67 | var results: [[String: Any]] = [] 68 | for purchase in purchases { 69 | switch purchase.transaction.transactionState { 70 | case .purchased, .restored: 71 | if purchase.needsFinishTransaction { 72 | // Deliver content from server, then: 73 | SwiftyStoreKit.finishTransaction(purchase.transaction) 74 | } 75 | results.append([ 76 | "productId": purchase.productId, 77 | "transactionState": purchase.transaction.transactionState.rawValue 78 | ]) 79 | case .failed, .purchasing, .deferred: 80 | break // do nothing 81 | @unknown default: 82 | break 83 | } 84 | } 85 | if results.count > 0, let callback = callback { 86 | callback.call([["results": results]], thisObject: self) 87 | } 88 | } 89 | } 90 | 91 | @objc(retrieveProductsInfo:) 92 | func retrieveProductsInfo(arguments: [Any]?) { 93 | guard let arguments = arguments, let params = arguments[0] as? [String: Any] else { fatalError() } 94 | 95 | guard let identifiers = params["identifiers"] as? [String], 96 | let callback = params["callback"] as? KrollCallback else { fatalError() } 97 | 98 | SwiftyStoreKit.retrieveProductsInfo(Set(identifiers)) { result in 99 | if result.error != nil { 100 | callback.call([ 101 | [ 102 | "success": false, 103 | "error": result.error?.localizedDescription ?? "Unknown error" 104 | ] 105 | ], thisObject: self) 106 | return 107 | } 108 | 109 | let event = [ 110 | "success": true, 111 | "retrievedProducts": result.retrievedProducts.map { 112 | TiIapProductProxy()._init(withPageContext: self.pageContext, product: $0)!.toObject() 113 | }, 114 | "invalidProductIDs": Array(result.invalidProductIDs) 115 | ] as [String: Any] 116 | 117 | callback.call([event], thisObject: self) 118 | } 119 | } 120 | 121 | @objc(purchase:) 122 | func purchase(arguments: [Any]?) { 123 | guard let arguments = arguments, let params = arguments[0] as? [String: Any] else { fatalError() } 124 | 125 | let quantity = params["quantity"] as? Int ?? 1 126 | let atomically = params["atomically"] as? Bool ?? true 127 | let applicationUsername = params["applicationUsername"] as? String ?? "" 128 | 129 | guard let identifier = params["identifier"] as? String, 130 | let callback = params["callback"] as? KrollCallback else { fatalError() } 131 | 132 | SwiftyStoreKit.purchaseProduct(identifier, 133 | quantity: quantity, 134 | atomically: atomically, 135 | applicationUsername: applicationUsername) { result in 136 | switch result { 137 | case .success(let purchase): 138 | if purchase.needsFinishTransaction { 139 | SwiftyStoreKit.finishTransaction(purchase.transaction) 140 | } 141 | 142 | if let receiptData = SwiftyStoreKit.localReceiptData { 143 | self.fire(callback, with: receiptData, and: purchase) 144 | return 145 | } 146 | 147 | SwiftyStoreKit.fetchReceipt(forceRefresh: true) { result in 148 | switch result { 149 | case .success(let receiptData): 150 | self.fire(callback, with: receiptData, and: purchase) 151 | case .error(let error): 152 | callback.call([["success": false, "error": error.localizedDescription]], thisObject: self) 153 | } 154 | } 155 | case .error(let error): 156 | callback.call([ 157 | [ 158 | "success": false, 159 | "error": error.localizedDescription, 160 | "code": error.code.rawValue, 161 | "message": self.errorMessageFromError(error) 162 | ] 163 | ], thisObject: self) 164 | case .deferred(purchase: _): 165 | NSLog("[WARN] Deferred purchase!") 166 | } 167 | } 168 | } 169 | 170 | @objc(fetchReceipt:) 171 | func fetchReceipt(arguments: [Any]?) { 172 | guard let arguments = arguments, let callback = arguments[0] as? KrollCallback else { fatalError() } 173 | 174 | SwiftyStoreKit.fetchReceipt(forceRefresh: true) { result in 175 | switch result { 176 | case .success(let receiptData): 177 | callback.call([[ 178 | "success": true, 179 | "receipt": receiptData.base64EncodedString(options: []) 180 | ]], thisObject: self) 181 | case .error(let error): 182 | callback.call([["success": false, "error": error.localizedDescription]], thisObject: self) 183 | } 184 | } 185 | } 186 | 187 | @objc(restorePurchases:) 188 | func restorePurchases(arguments: [Any]?) { 189 | guard let arguments = arguments, let params = arguments[0] as? [String: Any] else { fatalError() } 190 | 191 | guard let atomically = params["atomically"] as? Bool, 192 | let callback = params["callback"] as? KrollCallback else { fatalError() } 193 | 194 | SwiftyStoreKit.restorePurchases(atomically: atomically) { results in 195 | if results.restoreFailedPurchases.count > 0 { 196 | callback.call([ 197 | [ 198 | "success": false, 199 | "restoreFailedPurchases": results.restoreFailedPurchases.map({ $0.0.localizedDescription }) 200 | ] 201 | ], thisObject: self) 202 | } else if results.restoredPurchases.count > 0 { 203 | callback.call([ 204 | [ 205 | "success": true, 206 | "restoreFailedPurchases": [], 207 | "restoredPurchases": results.restoredPurchases.map({ 208 | ["productId": $0.productId, "transactionIdentifier": $0.transaction.transactionIdentifier] 209 | }) 210 | ] 211 | ], thisObject: self) 212 | } else { 213 | callback.call([ 214 | [ 215 | "success": true, 216 | "restoreFailedPurchases": [], 217 | "restoredPurchases": [] 218 | ] 219 | ], thisObject: self) 220 | print("Nothing to Restore") 221 | } 222 | } 223 | } 224 | 225 | @objc(shouldAddStorePaymentHandler:) 226 | func shouldAddStorePaymentHandler(arguments: [Any]?) { 227 | guard let arguments = arguments, let value = arguments[0] as? Bool else { fatalError() } 228 | 229 | SwiftyStoreKit.shouldAddStorePaymentHandler = { payment, product in 230 | if !value, let callback = arguments[1] as? KrollCallback { 231 | callback.call([ 232 | ["product": TiIapProductProxy()._init(withPageContext: self.pageContext, product: product)!.toObject()] 233 | ], thisObject: self) 234 | } 235 | return value 236 | } 237 | } 238 | 239 | @objc(verifyReceipt:) 240 | func verifyReceipt(arguments: [Any]?) { 241 | guard let arguments = arguments, let params = arguments[0] as? [String: Any] else { fatalError() } 242 | 243 | let service = params["service"] as? String ?? "sandbox" 244 | 245 | guard let sharedSecret = params["sharedSecret"] as? String, 246 | let productId = params["productId"] as? String, 247 | let callback = params["callback"] as? KrollCallback else { fatalError() } 248 | 249 | let appleValidator = AppleReceiptValidator(service: service == "production" ? .production : .sandbox, 250 | sharedSecret: sharedSecret) 251 | SwiftyStoreKit.verifyReceipt(using: appleValidator) { result in 252 | switch result { 253 | case .success(let receipt): 254 | let purchaseResult = SwiftyStoreKit.verifyPurchase(productId: productId, inReceipt: receipt) 255 | 256 | switch purchaseResult { 257 | case .purchased(let receiptItem): 258 | callback.call([[ 259 | "success": true, 260 | "purchased": true, 261 | "result": receiptItem.productId, 262 | "receipt": receipt as [String: Any] 263 | ]], thisObject: self) 264 | print("\(productId) is purchased: \(receiptItem)") 265 | case .notPurchased: 266 | callback.call([["success": true, "purchased": false]], thisObject: self) 267 | print("The user has never purchased \(productId)") 268 | } 269 | case .error(let error): 270 | callback.call([["success": false, "error": error.localizedDescription]], thisObject: self) 271 | print("Receipt verification failed: \(error)") 272 | } 273 | } 274 | } 275 | 276 | @objc(verifySubscription:) 277 | func verifySubscription(arguments: [Any]?) { 278 | guard let arguments = arguments, let params = arguments[0] as? [String: Any] else { fatalError() } 279 | 280 | let service = params["service"] as? String ?? "sandbox" 281 | 282 | guard let sharedSecret = params["sharedSecret"] as? String, 283 | let productId = params["productId"] as? String, 284 | let subscriptionRawType = params["subscriptionType"] as? Int, 285 | let callback = params["callback"] as? KrollCallback else { fatalError() } 286 | 287 | let validDuration = params["validDuration"] as? Double ?? 0 288 | 289 | let subscriptionType = subscriptionRawType == SUBSCRIPTION_TYPE_AUTO_RENEWABLE 290 | ? SubscriptionType.autoRenewable 291 | : SubscriptionType.nonRenewing(validDuration: TimeInterval(exactly: validDuration)!) 292 | 293 | let appleValidator = AppleReceiptValidator(service: service == "production" ? .production : .sandbox, 294 | sharedSecret: sharedSecret) 295 | 296 | SwiftyStoreKit.verifyReceipt(using: appleValidator) { result in 297 | switch result { 298 | case .success(let receipt): 299 | let subResult = SwiftyStoreKit.verifySubscription(ofType: subscriptionType, 300 | productId: productId, 301 | inReceipt: receipt) 302 | switch subResult { 303 | case .notPurchased: 304 | callback.call([["purchased": false, "expired": false]], thisObject: self) 305 | case .expired: 306 | callback.call([["purchased": false, "expired": true]], thisObject: self) 307 | case .purchased: 308 | callback.call([["purchased": true, "expired": false]], thisObject: self) 309 | } 310 | case .error(let error): 311 | callback.call([["success": false, "error": error.localizedDescription]], thisObject: self) 312 | } 313 | } 314 | } 315 | 316 | @objc(presentCodeRedemptionSheet:) 317 | func presentCodeRedemptionSheet(unused: [Any]?) { 318 | if #available(iOS 14.0, *) { 319 | SKPaymentQueue.default().presentCodeRedemptionSheet() 320 | } else { 321 | print("[ERROR] The \"presentCodeRedemptionSheet()\" function is only available on iOS 14+") 322 | } 323 | } 324 | 325 | // MARK: Utilities 326 | 327 | private func errorMessageFromError(_ error: SKError) -> String { 328 | var message = "Unknown error" 329 | 330 | switch error.code { 331 | case .unknown: message = "Unknown error. Please contact support" 332 | case .clientInvalid: message = "Not allowed to make the payment" 333 | case .paymentCancelled: message = "Payment cancelled" 334 | case .paymentInvalid: message = "The purchase identifier was invalid" 335 | case .paymentNotAllowed: message = "The device is not allowed to make the payment" 336 | case .storeProductNotAvailable: message = "The product is not available in the current storefront" 337 | case .cloudServicePermissionDenied: message = "Access to cloud service information is not allowed" 338 | case .cloudServiceNetworkConnectionFailed: message = "Could not connect to the network" 339 | case .cloudServiceRevoked: message = "User has revoked permission to use this cloud service" 340 | default: print((error as NSError).localizedDescription) 341 | } 342 | 343 | return message 344 | } 345 | 346 | private func fire(_ callback: KrollCallback, with receiptData: Data, and purchase: PurchaseDetails) { 347 | callback.call([[ 348 | "success": true, 349 | "productId": purchase.productId, 350 | "transactionIdentifier": purchase.transaction.transactionIdentifier ?? "", 351 | "transactionDate": purchase.transaction.transactionDate ?? "", 352 | "transactionState": purchase.transaction.transactionState.rawValue, 353 | "receipt": receiptData.base64EncodedString(options: []) 354 | ]], thisObject: self) 355 | } 356 | } 357 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/macos-arm64_x86_64/SwiftyStoreKit.framework/Versions/A/Headers/SwiftyStoreKit-Swift.h: -------------------------------------------------------------------------------- 1 | #if 0 2 | #elif defined(__arm64__) && __arm64__ 3 | // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) 4 | #ifndef SWIFTYSTOREKIT_SWIFT_H 5 | #define SWIFTYSTOREKIT_SWIFT_H 6 | #pragma clang diagnostic push 7 | #pragma clang diagnostic ignored "-Wgcc-compat" 8 | 9 | #if !defined(__has_include) 10 | # define __has_include(x) 0 11 | #endif 12 | #if !defined(__has_attribute) 13 | # define __has_attribute(x) 0 14 | #endif 15 | #if !defined(__has_feature) 16 | # define __has_feature(x) 0 17 | #endif 18 | #if !defined(__has_warning) 19 | # define __has_warning(x) 0 20 | #endif 21 | 22 | #if __has_include() 23 | # include 24 | #endif 25 | 26 | #pragma clang diagnostic ignored "-Wduplicate-method-match" 27 | #pragma clang diagnostic ignored "-Wauto-import" 28 | #if defined(__OBJC__) 29 | #include 30 | #endif 31 | #if defined(__cplusplus) 32 | #include 33 | #include 34 | #include 35 | #else 36 | #include 37 | #include 38 | #include 39 | #endif 40 | 41 | #if !defined(SWIFT_TYPEDEFS) 42 | # define SWIFT_TYPEDEFS 1 43 | # if __has_include() 44 | # include 45 | # elif !defined(__cplusplus) 46 | typedef uint_least16_t char16_t; 47 | typedef uint_least32_t char32_t; 48 | # endif 49 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 50 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 51 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 52 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 53 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 54 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 55 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 56 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 57 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 58 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 59 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 60 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 61 | #endif 62 | 63 | #if !defined(SWIFT_PASTE) 64 | # define SWIFT_PASTE_HELPER(x, y) x##y 65 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 66 | #endif 67 | #if !defined(SWIFT_METATYPE) 68 | # define SWIFT_METATYPE(X) Class 69 | #endif 70 | #if !defined(SWIFT_CLASS_PROPERTY) 71 | # if __has_feature(objc_class_property) 72 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 73 | # else 74 | # define SWIFT_CLASS_PROPERTY(...) 75 | # endif 76 | #endif 77 | 78 | #if __has_attribute(objc_runtime_name) 79 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 80 | #else 81 | # define SWIFT_RUNTIME_NAME(X) 82 | #endif 83 | #if __has_attribute(swift_name) 84 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 85 | #else 86 | # define SWIFT_COMPILE_NAME(X) 87 | #endif 88 | #if __has_attribute(objc_method_family) 89 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 90 | #else 91 | # define SWIFT_METHOD_FAMILY(X) 92 | #endif 93 | #if __has_attribute(noescape) 94 | # define SWIFT_NOESCAPE __attribute__((noescape)) 95 | #else 96 | # define SWIFT_NOESCAPE 97 | #endif 98 | #if __has_attribute(ns_consumed) 99 | # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) 100 | #else 101 | # define SWIFT_RELEASES_ARGUMENT 102 | #endif 103 | #if __has_attribute(warn_unused_result) 104 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 105 | #else 106 | # define SWIFT_WARN_UNUSED_RESULT 107 | #endif 108 | #if __has_attribute(noreturn) 109 | # define SWIFT_NORETURN __attribute__((noreturn)) 110 | #else 111 | # define SWIFT_NORETURN 112 | #endif 113 | #if !defined(SWIFT_CLASS_EXTRA) 114 | # define SWIFT_CLASS_EXTRA 115 | #endif 116 | #if !defined(SWIFT_PROTOCOL_EXTRA) 117 | # define SWIFT_PROTOCOL_EXTRA 118 | #endif 119 | #if !defined(SWIFT_ENUM_EXTRA) 120 | # define SWIFT_ENUM_EXTRA 121 | #endif 122 | #if !defined(SWIFT_CLASS) 123 | # if __has_attribute(objc_subclassing_restricted) 124 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 125 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 126 | # else 127 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 128 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 129 | # endif 130 | #endif 131 | #if !defined(SWIFT_RESILIENT_CLASS) 132 | # if __has_attribute(objc_class_stub) 133 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) 134 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) 135 | # else 136 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) 137 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) 138 | # endif 139 | #endif 140 | 141 | #if !defined(SWIFT_PROTOCOL) 142 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 143 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 144 | #endif 145 | 146 | #if !defined(SWIFT_EXTENSION) 147 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 148 | #endif 149 | 150 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 151 | # if __has_attribute(objc_designated_initializer) 152 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 153 | # else 154 | # define OBJC_DESIGNATED_INITIALIZER 155 | # endif 156 | #endif 157 | #if !defined(SWIFT_ENUM_ATTR) 158 | # if defined(__has_attribute) && __has_attribute(enum_extensibility) 159 | # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) 160 | # else 161 | # define SWIFT_ENUM_ATTR(_extensibility) 162 | # endif 163 | #endif 164 | #if !defined(SWIFT_ENUM) 165 | # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 166 | # if __has_feature(generalized_swift_name) 167 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 168 | # else 169 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) 170 | # endif 171 | #endif 172 | #if !defined(SWIFT_UNAVAILABLE) 173 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 174 | #endif 175 | #if !defined(SWIFT_UNAVAILABLE_MSG) 176 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 177 | #endif 178 | #if !defined(SWIFT_AVAILABILITY) 179 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 180 | #endif 181 | #if !defined(SWIFT_WEAK_IMPORT) 182 | # define SWIFT_WEAK_IMPORT __attribute__((weak_import)) 183 | #endif 184 | #if !defined(SWIFT_DEPRECATED) 185 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 186 | #endif 187 | #if !defined(SWIFT_DEPRECATED_MSG) 188 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 189 | #endif 190 | #if __has_feature(attribute_diagnose_if_objc) 191 | # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) 192 | #else 193 | # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) 194 | #endif 195 | #if defined(__OBJC__) 196 | #if !defined(IBSegueAction) 197 | # define IBSegueAction 198 | #endif 199 | #endif 200 | #if !defined(SWIFT_EXTERN) 201 | # if defined(__cplusplus) 202 | # define SWIFT_EXTERN extern "C" 203 | # else 204 | # define SWIFT_EXTERN extern 205 | # endif 206 | #endif 207 | #if !defined(SWIFT_CALL) 208 | # define SWIFT_CALL __attribute__((swiftcall)) 209 | #endif 210 | #if defined(__cplusplus) 211 | #if !defined(SWIFT_NOEXCEPT) 212 | # define SWIFT_NOEXCEPT noexcept 213 | #endif 214 | #else 215 | #if !defined(SWIFT_NOEXCEPT) 216 | # define SWIFT_NOEXCEPT 217 | #endif 218 | #endif 219 | #if defined(__cplusplus) 220 | #if !defined(SWIFT_CXX_INT_DEFINED) 221 | #define SWIFT_CXX_INT_DEFINED 222 | namespace swift { 223 | using Int = ptrdiff_t; 224 | using UInt = size_t; 225 | } 226 | #endif 227 | #endif 228 | #if defined(__OBJC__) 229 | #if __has_feature(modules) 230 | #if __has_warning("-Watimport-in-framework-header") 231 | #pragma clang diagnostic ignored "-Watimport-in-framework-header" 232 | #endif 233 | @import StoreKit; 234 | #endif 235 | 236 | #endif 237 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 238 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 239 | #if __has_warning("-Wpragma-clang-attribute") 240 | # pragma clang diagnostic ignored "-Wpragma-clang-attribute" 241 | #endif 242 | #pragma clang diagnostic ignored "-Wunknown-pragmas" 243 | #pragma clang diagnostic ignored "-Wnullability" 244 | #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" 245 | 246 | #if __has_attribute(external_source_symbol) 247 | # pragma push_macro("any") 248 | # undef any 249 | # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SwiftyStoreKit",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) 250 | # pragma pop_macro("any") 251 | #endif 252 | 253 | #if defined(__OBJC__) 254 | 255 | 256 | 257 | @class NSString; 258 | 259 | @interface SKPaymentTransaction (SWIFT_EXTENSION(SwiftyStoreKit)) 260 | @property (nonatomic, readonly, copy) NSString * _Nonnull debugDescription; 261 | @end 262 | 263 | 264 | 265 | #endif 266 | #if defined(__cplusplus) 267 | #endif 268 | #if __has_attribute(external_source_symbol) 269 | # pragma clang attribute pop 270 | #endif 271 | #pragma clang diagnostic pop 272 | #endif 273 | 274 | #elif defined(__x86_64__) && __x86_64__ 275 | // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) 276 | #ifndef SWIFTYSTOREKIT_SWIFT_H 277 | #define SWIFTYSTOREKIT_SWIFT_H 278 | #pragma clang diagnostic push 279 | #pragma clang diagnostic ignored "-Wgcc-compat" 280 | 281 | #if !defined(__has_include) 282 | # define __has_include(x) 0 283 | #endif 284 | #if !defined(__has_attribute) 285 | # define __has_attribute(x) 0 286 | #endif 287 | #if !defined(__has_feature) 288 | # define __has_feature(x) 0 289 | #endif 290 | #if !defined(__has_warning) 291 | # define __has_warning(x) 0 292 | #endif 293 | 294 | #if __has_include() 295 | # include 296 | #endif 297 | 298 | #pragma clang diagnostic ignored "-Wduplicate-method-match" 299 | #pragma clang diagnostic ignored "-Wauto-import" 300 | #if defined(__OBJC__) 301 | #include 302 | #endif 303 | #if defined(__cplusplus) 304 | #include 305 | #include 306 | #include 307 | #else 308 | #include 309 | #include 310 | #include 311 | #endif 312 | 313 | #if !defined(SWIFT_TYPEDEFS) 314 | # define SWIFT_TYPEDEFS 1 315 | # if __has_include() 316 | # include 317 | # elif !defined(__cplusplus) 318 | typedef uint_least16_t char16_t; 319 | typedef uint_least32_t char32_t; 320 | # endif 321 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 322 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 323 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 324 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 325 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 326 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 327 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 328 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 329 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 330 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 331 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 332 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 333 | #endif 334 | 335 | #if !defined(SWIFT_PASTE) 336 | # define SWIFT_PASTE_HELPER(x, y) x##y 337 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 338 | #endif 339 | #if !defined(SWIFT_METATYPE) 340 | # define SWIFT_METATYPE(X) Class 341 | #endif 342 | #if !defined(SWIFT_CLASS_PROPERTY) 343 | # if __has_feature(objc_class_property) 344 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 345 | # else 346 | # define SWIFT_CLASS_PROPERTY(...) 347 | # endif 348 | #endif 349 | 350 | #if __has_attribute(objc_runtime_name) 351 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 352 | #else 353 | # define SWIFT_RUNTIME_NAME(X) 354 | #endif 355 | #if __has_attribute(swift_name) 356 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 357 | #else 358 | # define SWIFT_COMPILE_NAME(X) 359 | #endif 360 | #if __has_attribute(objc_method_family) 361 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 362 | #else 363 | # define SWIFT_METHOD_FAMILY(X) 364 | #endif 365 | #if __has_attribute(noescape) 366 | # define SWIFT_NOESCAPE __attribute__((noescape)) 367 | #else 368 | # define SWIFT_NOESCAPE 369 | #endif 370 | #if __has_attribute(ns_consumed) 371 | # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) 372 | #else 373 | # define SWIFT_RELEASES_ARGUMENT 374 | #endif 375 | #if __has_attribute(warn_unused_result) 376 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 377 | #else 378 | # define SWIFT_WARN_UNUSED_RESULT 379 | #endif 380 | #if __has_attribute(noreturn) 381 | # define SWIFT_NORETURN __attribute__((noreturn)) 382 | #else 383 | # define SWIFT_NORETURN 384 | #endif 385 | #if !defined(SWIFT_CLASS_EXTRA) 386 | # define SWIFT_CLASS_EXTRA 387 | #endif 388 | #if !defined(SWIFT_PROTOCOL_EXTRA) 389 | # define SWIFT_PROTOCOL_EXTRA 390 | #endif 391 | #if !defined(SWIFT_ENUM_EXTRA) 392 | # define SWIFT_ENUM_EXTRA 393 | #endif 394 | #if !defined(SWIFT_CLASS) 395 | # if __has_attribute(objc_subclassing_restricted) 396 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 397 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 398 | # else 399 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 400 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 401 | # endif 402 | #endif 403 | #if !defined(SWIFT_RESILIENT_CLASS) 404 | # if __has_attribute(objc_class_stub) 405 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) 406 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) 407 | # else 408 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) 409 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) 410 | # endif 411 | #endif 412 | 413 | #if !defined(SWIFT_PROTOCOL) 414 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 415 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 416 | #endif 417 | 418 | #if !defined(SWIFT_EXTENSION) 419 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 420 | #endif 421 | 422 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 423 | # if __has_attribute(objc_designated_initializer) 424 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 425 | # else 426 | # define OBJC_DESIGNATED_INITIALIZER 427 | # endif 428 | #endif 429 | #if !defined(SWIFT_ENUM_ATTR) 430 | # if defined(__has_attribute) && __has_attribute(enum_extensibility) 431 | # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) 432 | # else 433 | # define SWIFT_ENUM_ATTR(_extensibility) 434 | # endif 435 | #endif 436 | #if !defined(SWIFT_ENUM) 437 | # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 438 | # if __has_feature(generalized_swift_name) 439 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 440 | # else 441 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) 442 | # endif 443 | #endif 444 | #if !defined(SWIFT_UNAVAILABLE) 445 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 446 | #endif 447 | #if !defined(SWIFT_UNAVAILABLE_MSG) 448 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 449 | #endif 450 | #if !defined(SWIFT_AVAILABILITY) 451 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 452 | #endif 453 | #if !defined(SWIFT_WEAK_IMPORT) 454 | # define SWIFT_WEAK_IMPORT __attribute__((weak_import)) 455 | #endif 456 | #if !defined(SWIFT_DEPRECATED) 457 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 458 | #endif 459 | #if !defined(SWIFT_DEPRECATED_MSG) 460 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 461 | #endif 462 | #if __has_feature(attribute_diagnose_if_objc) 463 | # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) 464 | #else 465 | # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) 466 | #endif 467 | #if defined(__OBJC__) 468 | #if !defined(IBSegueAction) 469 | # define IBSegueAction 470 | #endif 471 | #endif 472 | #if !defined(SWIFT_EXTERN) 473 | # if defined(__cplusplus) 474 | # define SWIFT_EXTERN extern "C" 475 | # else 476 | # define SWIFT_EXTERN extern 477 | # endif 478 | #endif 479 | #if !defined(SWIFT_CALL) 480 | # define SWIFT_CALL __attribute__((swiftcall)) 481 | #endif 482 | #if defined(__cplusplus) 483 | #if !defined(SWIFT_NOEXCEPT) 484 | # define SWIFT_NOEXCEPT noexcept 485 | #endif 486 | #else 487 | #if !defined(SWIFT_NOEXCEPT) 488 | # define SWIFT_NOEXCEPT 489 | #endif 490 | #endif 491 | #if defined(__cplusplus) 492 | #if !defined(SWIFT_CXX_INT_DEFINED) 493 | #define SWIFT_CXX_INT_DEFINED 494 | namespace swift { 495 | using Int = ptrdiff_t; 496 | using UInt = size_t; 497 | } 498 | #endif 499 | #endif 500 | #if defined(__OBJC__) 501 | #if __has_feature(modules) 502 | #if __has_warning("-Watimport-in-framework-header") 503 | #pragma clang diagnostic ignored "-Watimport-in-framework-header" 504 | #endif 505 | @import StoreKit; 506 | #endif 507 | 508 | #endif 509 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 510 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 511 | #if __has_warning("-Wpragma-clang-attribute") 512 | # pragma clang diagnostic ignored "-Wpragma-clang-attribute" 513 | #endif 514 | #pragma clang diagnostic ignored "-Wunknown-pragmas" 515 | #pragma clang diagnostic ignored "-Wnullability" 516 | #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" 517 | 518 | #if __has_attribute(external_source_symbol) 519 | # pragma push_macro("any") 520 | # undef any 521 | # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SwiftyStoreKit",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) 522 | # pragma pop_macro("any") 523 | #endif 524 | 525 | #if defined(__OBJC__) 526 | 527 | 528 | 529 | @class NSString; 530 | 531 | @interface SKPaymentTransaction (SWIFT_EXTENSION(SwiftyStoreKit)) 532 | @property (nonatomic, readonly, copy) NSString * _Nonnull debugDescription; 533 | @end 534 | 535 | 536 | 537 | #endif 538 | #if defined(__cplusplus) 539 | #endif 540 | #if __has_attribute(external_source_symbol) 541 | # pragma clang attribute pop 542 | #endif 543 | #pragma clang diagnostic pop 544 | #endif 545 | 546 | #else 547 | #error unsupported Swift architecture 548 | #endif 549 | -------------------------------------------------------------------------------- /ios/titanium-in-app-purchase.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 52; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 000000000000000000000002 /* TitaniumKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 000000000000000000000001 /* TitaniumKit.xcframework */; }; 11 | 3A6E12A22414E4E300882ECE /* TiIapProductProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A6E12A12414E4E300882ECE /* TiIapProductProxy.swift */; }; 12 | 3AB2CDAA274924120045FE04 /* SwiftyStoreKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AB2CDA9274924120045FE04 /* SwiftyStoreKit.xcframework */; }; 13 | DB34CDE0207B998A005F8E8C /* TiIapModuleAssets.m in Sources */ = {isa = PBXBuildFile; fileRef = DB34CDDE207B998A005F8E8C /* TiIapModuleAssets.m */; }; 14 | DB34CDE1207B998A005F8E8C /* TiIapModuleAssets.h in Headers */ = {isa = PBXBuildFile; fileRef = DB34CDDF207B998A005F8E8C /* TiIapModuleAssets.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | DB34CDE6207B9EBD005F8E8C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB34CDE5207B9EBD005F8E8C /* Foundation.framework */; }; 16 | DB52E2401E9CCF8D00AAAEE0 /* TiIap_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = DB52E23F1E9CCF8D00AAAEE0 /* TiIap_Prefix.pch */; }; 17 | DB52E2431E9CD0F800AAAEE0 /* TiIapModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB52E2421E9CD0F800AAAEE0 /* TiIapModule.swift */; }; 18 | DB75E5161E9CD59000809B2D /* TiIap.h in Headers */ = {isa = PBXBuildFile; fileRef = DB75E5151E9CD58100809B2D /* TiIap.h */; settings = {ATTRIBUTES = (Public, ); }; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 000000000000000000000001 /* TitaniumKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TitaniumKit.xcframework; path = "$(TITANIUM_SDK)/iphone/Frameworks/TitaniumKit.xcframework"; sourceTree = ""; }; 23 | 3A6E12A12414E4E300882ECE /* TiIapProductProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TiIapProductProxy.swift; path = Classes/TiIapProductProxy.swift; sourceTree = ""; }; 24 | 3AB2CDA9274924120045FE04 /* SwiftyStoreKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = SwiftyStoreKit.xcframework; path = platform/SwiftyStoreKit.xcframework; sourceTree = ""; }; 25 | DB34CDDE207B998A005F8E8C /* TiIapModuleAssets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TiIapModuleAssets.m; path = Classes/TiIapModuleAssets.m; sourceTree = SOURCE_ROOT; }; 26 | DB34CDDF207B998A005F8E8C /* TiIapModuleAssets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TiIapModuleAssets.h; path = Classes/TiIapModuleAssets.h; sourceTree = SOURCE_ROOT; }; 27 | DB34CDE5207B9EBD005F8E8C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 28 | DB52E22A1E9CCD7000AAAEE0 /* TiIap.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TiIap.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | DB52E22E1E9CCD7000AAAEE0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 30 | DB52E23F1E9CCF8D00AAAEE0 /* TiIap_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TiIap_Prefix.pch; sourceTree = SOURCE_ROOT; }; 31 | DB52E2411E9CD09900AAAEE0 /* titanium.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = titanium.xcconfig; sourceTree = ""; }; 32 | DB52E2421E9CD0F800AAAEE0 /* TiIapModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TiIapModule.swift; path = Classes/TiIapModule.swift; sourceTree = ""; }; 33 | DB75E5151E9CD58100809B2D /* TiIap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TiIap.h; path = Classes/TiIap.h; sourceTree = ""; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | DB52E2261E9CCD7000AAAEE0 /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | 3AB2CDAA274924120045FE04 /* SwiftyStoreKit.xcframework in Frameworks */, 42 | DB34CDE6207B9EBD005F8E8C /* Foundation.framework in Frameworks */, 43 | 000000000000000000000002 /* TitaniumKit.xcframework in Frameworks */, 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | DB258CA41F0964DE000D0D8D /* Misc */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | DB52E2411E9CD09900AAAEE0 /* titanium.xcconfig */, 54 | DB34CDDF207B998A005F8E8C /* TiIapModuleAssets.h */, 55 | DB34CDDE207B998A005F8E8C /* TiIapModuleAssets.m */, 56 | DB75E5151E9CD58100809B2D /* TiIap.h */, 57 | DB52E23F1E9CCF8D00AAAEE0 /* TiIap_Prefix.pch */, 58 | DB52E22E1E9CCD7000AAAEE0 /* Info.plist */, 59 | ); 60 | name = Misc; 61 | sourceTree = ""; 62 | }; 63 | DB258CA51F0964F6000D0D8D /* Sources */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | DB52E2421E9CD0F800AAAEE0 /* TiIapModule.swift */, 67 | 3A6E12A12414E4E300882ECE /* TiIapProductProxy.swift */, 68 | ); 69 | name = Sources; 70 | sourceTree = ""; 71 | }; 72 | DB34CDE2207B9D6A005F8E8C /* Frameworks */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 3AB2CDA9274924120045FE04 /* SwiftyStoreKit.xcframework */, 76 | DB34CDE5207B9EBD005F8E8C /* Foundation.framework */, 77 | 000000000000000000000001 /* TitaniumKit.xcframework */, 78 | ); 79 | name = Frameworks; 80 | sourceTree = ""; 81 | }; 82 | DB52E2201E9CCD7000AAAEE0 = { 83 | isa = PBXGroup; 84 | children = ( 85 | DB52E22C1E9CCD7000AAAEE0 /* In App Billing Module */, 86 | DB52E22B1E9CCD7000AAAEE0 /* Products */, 87 | DB34CDE2207B9D6A005F8E8C /* Frameworks */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | DB52E22B1E9CCD7000AAAEE0 /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | DB52E22A1E9CCD7000AAAEE0 /* TiIap.framework */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | DB52E22C1E9CCD7000AAAEE0 /* In App Billing Module */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | DB258CA51F0964F6000D0D8D /* Sources */, 103 | DB258CA41F0964DE000D0D8D /* Misc */, 104 | ); 105 | name = "In App Billing Module"; 106 | sourceTree = ""; 107 | }; 108 | /* End PBXGroup section */ 109 | 110 | /* Begin PBXHeadersBuildPhase section */ 111 | DB52E2271E9CCD7000AAAEE0 /* Headers */ = { 112 | isa = PBXHeadersBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | DB75E5161E9CD59000809B2D /* TiIap.h in Headers */, 116 | DB34CDE1207B998A005F8E8C /* TiIapModuleAssets.h in Headers */, 117 | DB52E2401E9CCF8D00AAAEE0 /* TiIap_Prefix.pch in Headers */, 118 | ); 119 | runOnlyForDeploymentPostprocessing = 0; 120 | }; 121 | /* End PBXHeadersBuildPhase section */ 122 | 123 | /* Begin PBXNativeTarget section */ 124 | DB52E2291E9CCD7000AAAEE0 /* TiIap */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = DB52E2321E9CCD7000AAAEE0 /* Build configuration list for PBXNativeTarget "TiIap" */; 127 | buildPhases = ( 128 | DB52E2251E9CCD7000AAAEE0 /* Sources */, 129 | DB52E2261E9CCD7000AAAEE0 /* Frameworks */, 130 | DB52E2271E9CCD7000AAAEE0 /* Headers */, 131 | DB52E2281E9CCD7000AAAEE0 /* Resources */, 132 | ); 133 | buildRules = ( 134 | ); 135 | dependencies = ( 136 | DBB66220208481A400EAD6D9 /* PBXTargetDependency */, 137 | ); 138 | name = TiIap; 139 | productName = TiIap; 140 | productReference = DB52E22A1E9CCD7000AAAEE0 /* TiIap.framework */; 141 | productType = "com.apple.product-type.framework"; 142 | }; 143 | /* End PBXNativeTarget section */ 144 | 145 | /* Begin PBXProject section */ 146 | DB52E2211E9CCD7000AAAEE0 /* Project object */ = { 147 | isa = PBXProject; 148 | attributes = { 149 | LastUpgradeCheck = 1310; 150 | TargetAttributes = { 151 | DB52E2291E9CCD7000AAAEE0 = { 152 | CreatedOnToolsVersion = 8.3; 153 | LastSwiftMigration = 940; 154 | ProvisioningStyle = Automatic; 155 | }; 156 | }; 157 | }; 158 | buildConfigurationList = DB52E2241E9CCD7000AAAEE0 /* Build configuration list for PBXProject "titanium-in-app-purchase" */; 159 | compatibilityVersion = "Xcode 3.2"; 160 | developmentRegion = en; 161 | hasScannedForEncodings = 0; 162 | knownRegions = ( 163 | en, 164 | Base, 165 | ); 166 | mainGroup = DB52E2201E9CCD7000AAAEE0; 167 | productRefGroup = DB52E22B1E9CCD7000AAAEE0 /* Products */; 168 | projectDirPath = ""; 169 | projectRoot = ""; 170 | targets = ( 171 | DB52E2291E9CCD7000AAAEE0 /* TiIap */, 172 | ); 173 | }; 174 | /* End PBXProject section */ 175 | 176 | /* Begin PBXResourcesBuildPhase section */ 177 | DB52E2281E9CCD7000AAAEE0 /* Resources */ = { 178 | isa = PBXResourcesBuildPhase; 179 | buildActionMask = 2147483647; 180 | files = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | }; 184 | /* End PBXResourcesBuildPhase section */ 185 | 186 | /* Begin PBXSourcesBuildPhase section */ 187 | DB52E2251E9CCD7000AAAEE0 /* Sources */ = { 188 | isa = PBXSourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | DB34CDE0207B998A005F8E8C /* TiIapModuleAssets.m in Sources */, 192 | DB52E2431E9CD0F800AAAEE0 /* TiIapModule.swift in Sources */, 193 | 3A6E12A22414E4E300882ECE /* TiIapProductProxy.swift in Sources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXSourcesBuildPhase section */ 198 | 199 | /* Begin PBXTargetDependency section */ 200 | DBB66220208481A400EAD6D9 /* PBXTargetDependency */ = { 201 | isa = PBXTargetDependency; 202 | name = TitaniumKit; 203 | }; 204 | /* End PBXTargetDependency section */ 205 | 206 | /* Begin XCBuildConfiguration section */ 207 | DB52E2301E9CCD7000AAAEE0 /* Debug */ = { 208 | isa = XCBuildConfiguration; 209 | baseConfigurationReference = DB52E2411E9CD09900AAAEE0 /* titanium.xcconfig */; 210 | buildSettings = { 211 | ALWAYS_SEARCH_USER_PATHS = NO; 212 | CLANG_ANALYZER_NONNULL = YES; 213 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 214 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 215 | CLANG_CXX_LIBRARY = "libc++"; 216 | CLANG_ENABLE_MODULES = YES; 217 | CLANG_ENABLE_OBJC_ARC = YES; 218 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 219 | CLANG_WARN_BOOL_CONVERSION = YES; 220 | CLANG_WARN_COMMA = YES; 221 | CLANG_WARN_CONSTANT_CONVERSION = YES; 222 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 223 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 224 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 225 | CLANG_WARN_EMPTY_BODY = YES; 226 | CLANG_WARN_ENUM_CONVERSION = YES; 227 | CLANG_WARN_INFINITE_RECURSION = YES; 228 | CLANG_WARN_INT_CONVERSION = YES; 229 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 230 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 231 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 232 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 233 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 234 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 235 | CLANG_WARN_STRICT_PROTOTYPES = YES; 236 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 237 | CLANG_WARN_UNREACHABLE_CODE = YES; 238 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 239 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 240 | COPY_PHASE_STRIP = NO; 241 | CURRENT_PROJECT_VERSION = 1; 242 | DEBUG_INFORMATION_FORMAT = dwarf; 243 | DEFINES_MODULE = YES; 244 | ENABLE_BITCODE = NO; 245 | ENABLE_STRICT_OBJC_MSGSEND = YES; 246 | ENABLE_TESTABILITY = YES; 247 | GCC_C_LANGUAGE_STANDARD = gnu99; 248 | GCC_DYNAMIC_NO_PIC = NO; 249 | GCC_NO_COMMON_BLOCKS = YES; 250 | GCC_OPTIMIZATION_LEVEL = 0; 251 | GCC_PREPROCESSOR_DEFINITIONS = ( 252 | "DEBUG=1", 253 | "$(inherited)", 254 | ); 255 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 256 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 257 | GCC_WARN_UNDECLARED_SELECTOR = YES; 258 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 259 | GCC_WARN_UNUSED_FUNCTION = YES; 260 | GCC_WARN_UNUSED_VARIABLE = YES; 261 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 262 | MTL_ENABLE_DEBUG_INFO = YES; 263 | ONLY_ACTIVE_ARCH = YES; 264 | SDKROOT = iphoneos; 265 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 266 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 267 | TARGETED_DEVICE_FAMILY = "1,2"; 268 | VALID_ARCHS = "$(ARCHS_STANDARD)"; 269 | VERSIONING_SYSTEM = "apple-generic"; 270 | VERSION_INFO_PREFIX = ""; 271 | }; 272 | name = Debug; 273 | }; 274 | DB52E2311E9CCD7000AAAEE0 /* Release */ = { 275 | isa = XCBuildConfiguration; 276 | baseConfigurationReference = DB52E2411E9CD09900AAAEE0 /* titanium.xcconfig */; 277 | buildSettings = { 278 | ALWAYS_SEARCH_USER_PATHS = NO; 279 | CLANG_ANALYZER_NONNULL = YES; 280 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 281 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 282 | CLANG_CXX_LIBRARY = "libc++"; 283 | CLANG_ENABLE_MODULES = YES; 284 | CLANG_ENABLE_OBJC_ARC = YES; 285 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 286 | CLANG_WARN_BOOL_CONVERSION = YES; 287 | CLANG_WARN_COMMA = YES; 288 | CLANG_WARN_CONSTANT_CONVERSION = YES; 289 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 291 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 292 | CLANG_WARN_EMPTY_BODY = YES; 293 | CLANG_WARN_ENUM_CONVERSION = YES; 294 | CLANG_WARN_INFINITE_RECURSION = YES; 295 | CLANG_WARN_INT_CONVERSION = YES; 296 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 297 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 298 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 299 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 300 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 301 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 302 | CLANG_WARN_STRICT_PROTOTYPES = YES; 303 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 304 | CLANG_WARN_UNREACHABLE_CODE = YES; 305 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 306 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 307 | COPY_PHASE_STRIP = NO; 308 | CURRENT_PROJECT_VERSION = 1; 309 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 310 | DEFINES_MODULE = YES; 311 | ENABLE_BITCODE = NO; 312 | ENABLE_NS_ASSERTIONS = NO; 313 | ENABLE_STRICT_OBJC_MSGSEND = YES; 314 | GCC_C_LANGUAGE_STANDARD = gnu99; 315 | GCC_NO_COMMON_BLOCKS = YES; 316 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 318 | GCC_WARN_UNDECLARED_SELECTOR = YES; 319 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 320 | GCC_WARN_UNUSED_FUNCTION = YES; 321 | GCC_WARN_UNUSED_VARIABLE = YES; 322 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 323 | MTL_ENABLE_DEBUG_INFO = NO; 324 | SDKROOT = iphoneos; 325 | SWIFT_COMPILATION_MODE = wholemodule; 326 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 327 | TARGETED_DEVICE_FAMILY = "1,2"; 328 | VALIDATE_PRODUCT = YES; 329 | VALID_ARCHS = "$(ARCHS_STANDARD)"; 330 | VERSIONING_SYSTEM = "apple-generic"; 331 | VERSION_INFO_PREFIX = ""; 332 | }; 333 | name = Release; 334 | }; 335 | DB52E2331E9CCD7000AAAEE0 /* Debug */ = { 336 | isa = XCBuildConfiguration; 337 | baseConfigurationReference = DB52E2411E9CD09900AAAEE0 /* titanium.xcconfig */; 338 | buildSettings = { 339 | ALWAYS_SEARCH_USER_PATHS = NO; 340 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 341 | CLANG_ENABLE_MODULES = YES; 342 | CODE_SIGN_IDENTITY = ""; 343 | DEFINES_MODULE = YES; 344 | DYLIB_COMPATIBILITY_VERSION = 1; 345 | DYLIB_CURRENT_VERSION = 1; 346 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 347 | ENABLE_BITCODE = NO; 348 | FRAMEWORK_SEARCH_PATHS = ( 349 | "$(inherited)", 350 | "$(PROJECT_DIR)", 351 | "$(PROJECT_DIR)/platform", 352 | ); 353 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 354 | GCC_PREFIX_HEADER = TiIap_Prefix.pch; 355 | GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)"; 356 | INFOPLIST_FILE = Info.plist; 357 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 358 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 359 | LD_RUNPATH_SEARCH_PATHS = ( 360 | "$(inherited)", 361 | "@executable_path/Frameworks", 362 | "@loader_path/Frameworks", 363 | ); 364 | LIBRARY_SEARCH_PATHS = ""; 365 | OTHER_CFLAGS = ( 366 | "-DDEBUG", 367 | "-DTI_POST_1_2", 368 | ); 369 | OTHER_LDFLAGS = ( 370 | "-ObjC", 371 | "$(inherited)", 372 | ); 373 | PRODUCT_BUNDLE_IDENTIFIER = "com.appcelerator.titanium-in-app-purchase"; 374 | PRODUCT_NAME = "$(TARGET_NAME)"; 375 | SKIP_INSTALL = YES; 376 | SUPPORTS_MACCATALYST = NO; 377 | SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Titanium"; 378 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 379 | SWIFT_VERSION = 5.0; 380 | TARGETED_DEVICE_FAMILY = "1,2"; 381 | VALID_ARCHS = "$(ARCHS_STANDARD)"; 382 | }; 383 | name = Debug; 384 | }; 385 | DB52E2341E9CCD7000AAAEE0 /* Release */ = { 386 | isa = XCBuildConfiguration; 387 | baseConfigurationReference = DB52E2411E9CD09900AAAEE0 /* titanium.xcconfig */; 388 | buildSettings = { 389 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 390 | CLANG_ENABLE_MODULES = YES; 391 | CODE_SIGN_IDENTITY = ""; 392 | DEFINES_MODULE = YES; 393 | DYLIB_COMPATIBILITY_VERSION = 1; 394 | DYLIB_CURRENT_VERSION = 1; 395 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 396 | ENABLE_BITCODE = NO; 397 | FRAMEWORK_SEARCH_PATHS = ( 398 | "$(inherited)", 399 | "$(PROJECT_DIR)", 400 | "$(PROJECT_DIR)/platform", 401 | ); 402 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 403 | GCC_PREFIX_HEADER = TiIap_Prefix.pch; 404 | GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)"; 405 | INFOPLIST_FILE = Info.plist; 406 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 407 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 408 | LD_RUNPATH_SEARCH_PATHS = ( 409 | "$(inherited)", 410 | "@executable_path/Frameworks", 411 | "@loader_path/Frameworks", 412 | ); 413 | LIBRARY_SEARCH_PATHS = ""; 414 | OTHER_CFLAGS = "-DTI_POST_1_2"; 415 | OTHER_LDFLAGS = ( 416 | "-ObjC", 417 | "$(inherited)", 418 | ); 419 | PRODUCT_BUNDLE_IDENTIFIER = "com.appcelerator.titanium-in-app-purchase"; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | SKIP_INSTALL = YES; 422 | SUPPORTS_MACCATALYST = NO; 423 | SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Titanium"; 424 | SWIFT_VERSION = 5.0; 425 | TARGETED_DEVICE_FAMILY = "1,2"; 426 | VALID_ARCHS = "$(ARCHS_STANDARD)"; 427 | }; 428 | name = Release; 429 | }; 430 | /* End XCBuildConfiguration section */ 431 | 432 | /* Begin XCConfigurationList section */ 433 | DB52E2241E9CCD7000AAAEE0 /* Build configuration list for PBXProject "titanium-in-app-purchase" */ = { 434 | isa = XCConfigurationList; 435 | buildConfigurations = ( 436 | DB52E2301E9CCD7000AAAEE0 /* Debug */, 437 | DB52E2311E9CCD7000AAAEE0 /* Release */, 438 | ); 439 | defaultConfigurationIsVisible = 0; 440 | defaultConfigurationName = Release; 441 | }; 442 | DB52E2321E9CCD7000AAAEE0 /* Build configuration list for PBXNativeTarget "TiIap" */ = { 443 | isa = XCConfigurationList; 444 | buildConfigurations = ( 445 | DB52E2331E9CCD7000AAAEE0 /* Debug */, 446 | DB52E2341E9CCD7000AAAEE0 /* Release */, 447 | ); 448 | defaultConfigurationIsVisible = 0; 449 | defaultConfigurationName = Release; 450 | }; 451 | /* End XCConfigurationList section */ 452 | }; 453 | rootObject = DB52E2211E9CCD7000AAAEE0 /* Project object */; 454 | } 455 | -------------------------------------------------------------------------------- /ios/platform/SwiftyStoreKit.xcframework/watchos-arm64_x86_64-simulator/SwiftyStoreKit.framework/Headers/SwiftyStoreKit-Swift.h: -------------------------------------------------------------------------------- 1 | #if 0 2 | #elif defined(__arm64__) && __arm64__ 3 | // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) 4 | #ifndef SWIFTYSTOREKIT_SWIFT_H 5 | #define SWIFTYSTOREKIT_SWIFT_H 6 | #pragma clang diagnostic push 7 | #pragma clang diagnostic ignored "-Wgcc-compat" 8 | 9 | #if !defined(__has_include) 10 | # define __has_include(x) 0 11 | #endif 12 | #if !defined(__has_attribute) 13 | # define __has_attribute(x) 0 14 | #endif 15 | #if !defined(__has_feature) 16 | # define __has_feature(x) 0 17 | #endif 18 | #if !defined(__has_warning) 19 | # define __has_warning(x) 0 20 | #endif 21 | 22 | #if __has_include() 23 | # include 24 | #endif 25 | 26 | #pragma clang diagnostic ignored "-Wduplicate-method-match" 27 | #pragma clang diagnostic ignored "-Wauto-import" 28 | #if defined(__OBJC__) 29 | #include 30 | #endif 31 | #if defined(__cplusplus) 32 | #include 33 | #include 34 | #include 35 | #else 36 | #include 37 | #include 38 | #include 39 | #endif 40 | 41 | #if !defined(SWIFT_TYPEDEFS) 42 | # define SWIFT_TYPEDEFS 1 43 | # if __has_include() 44 | # include 45 | # elif !defined(__cplusplus) 46 | typedef uint_least16_t char16_t; 47 | typedef uint_least32_t char32_t; 48 | # endif 49 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 50 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 51 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 52 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 53 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 54 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 55 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 56 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 57 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 58 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 59 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 60 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 61 | #endif 62 | 63 | #if !defined(SWIFT_PASTE) 64 | # define SWIFT_PASTE_HELPER(x, y) x##y 65 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 66 | #endif 67 | #if !defined(SWIFT_METATYPE) 68 | # define SWIFT_METATYPE(X) Class 69 | #endif 70 | #if !defined(SWIFT_CLASS_PROPERTY) 71 | # if __has_feature(objc_class_property) 72 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 73 | # else 74 | # define SWIFT_CLASS_PROPERTY(...) 75 | # endif 76 | #endif 77 | 78 | #if __has_attribute(objc_runtime_name) 79 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 80 | #else 81 | # define SWIFT_RUNTIME_NAME(X) 82 | #endif 83 | #if __has_attribute(swift_name) 84 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 85 | #else 86 | # define SWIFT_COMPILE_NAME(X) 87 | #endif 88 | #if __has_attribute(objc_method_family) 89 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 90 | #else 91 | # define SWIFT_METHOD_FAMILY(X) 92 | #endif 93 | #if __has_attribute(noescape) 94 | # define SWIFT_NOESCAPE __attribute__((noescape)) 95 | #else 96 | # define SWIFT_NOESCAPE 97 | #endif 98 | #if __has_attribute(ns_consumed) 99 | # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) 100 | #else 101 | # define SWIFT_RELEASES_ARGUMENT 102 | #endif 103 | #if __has_attribute(warn_unused_result) 104 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 105 | #else 106 | # define SWIFT_WARN_UNUSED_RESULT 107 | #endif 108 | #if __has_attribute(noreturn) 109 | # define SWIFT_NORETURN __attribute__((noreturn)) 110 | #else 111 | # define SWIFT_NORETURN 112 | #endif 113 | #if !defined(SWIFT_CLASS_EXTRA) 114 | # define SWIFT_CLASS_EXTRA 115 | #endif 116 | #if !defined(SWIFT_PROTOCOL_EXTRA) 117 | # define SWIFT_PROTOCOL_EXTRA 118 | #endif 119 | #if !defined(SWIFT_ENUM_EXTRA) 120 | # define SWIFT_ENUM_EXTRA 121 | #endif 122 | #if !defined(SWIFT_CLASS) 123 | # if __has_attribute(objc_subclassing_restricted) 124 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 125 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 126 | # else 127 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 128 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 129 | # endif 130 | #endif 131 | #if !defined(SWIFT_RESILIENT_CLASS) 132 | # if __has_attribute(objc_class_stub) 133 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) 134 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) 135 | # else 136 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) 137 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) 138 | # endif 139 | #endif 140 | 141 | #if !defined(SWIFT_PROTOCOL) 142 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 143 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 144 | #endif 145 | 146 | #if !defined(SWIFT_EXTENSION) 147 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 148 | #endif 149 | 150 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 151 | # if __has_attribute(objc_designated_initializer) 152 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 153 | # else 154 | # define OBJC_DESIGNATED_INITIALIZER 155 | # endif 156 | #endif 157 | #if !defined(SWIFT_ENUM_ATTR) 158 | # if defined(__has_attribute) && __has_attribute(enum_extensibility) 159 | # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) 160 | # else 161 | # define SWIFT_ENUM_ATTR(_extensibility) 162 | # endif 163 | #endif 164 | #if !defined(SWIFT_ENUM) 165 | # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 166 | # if __has_feature(generalized_swift_name) 167 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 168 | # else 169 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) 170 | # endif 171 | #endif 172 | #if !defined(SWIFT_UNAVAILABLE) 173 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 174 | #endif 175 | #if !defined(SWIFT_UNAVAILABLE_MSG) 176 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 177 | #endif 178 | #if !defined(SWIFT_AVAILABILITY) 179 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 180 | #endif 181 | #if !defined(SWIFT_WEAK_IMPORT) 182 | # define SWIFT_WEAK_IMPORT __attribute__((weak_import)) 183 | #endif 184 | #if !defined(SWIFT_DEPRECATED) 185 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 186 | #endif 187 | #if !defined(SWIFT_DEPRECATED_MSG) 188 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 189 | #endif 190 | #if __has_feature(attribute_diagnose_if_objc) 191 | # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) 192 | #else 193 | # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) 194 | #endif 195 | #if defined(__OBJC__) 196 | #if !defined(IBSegueAction) 197 | # define IBSegueAction 198 | #endif 199 | #endif 200 | #if !defined(SWIFT_EXTERN) 201 | # if defined(__cplusplus) 202 | # define SWIFT_EXTERN extern "C" 203 | # else 204 | # define SWIFT_EXTERN extern 205 | # endif 206 | #endif 207 | #if !defined(SWIFT_CALL) 208 | # define SWIFT_CALL __attribute__((swiftcall)) 209 | #endif 210 | #if defined(__cplusplus) 211 | #if !defined(SWIFT_NOEXCEPT) 212 | # define SWIFT_NOEXCEPT noexcept 213 | #endif 214 | #else 215 | #if !defined(SWIFT_NOEXCEPT) 216 | # define SWIFT_NOEXCEPT 217 | #endif 218 | #endif 219 | #if defined(__cplusplus) 220 | #if !defined(SWIFT_CXX_INT_DEFINED) 221 | #define SWIFT_CXX_INT_DEFINED 222 | namespace swift { 223 | using Int = ptrdiff_t; 224 | using UInt = size_t; 225 | } 226 | #endif 227 | #endif 228 | #if defined(__OBJC__) 229 | #if __has_feature(modules) 230 | #if __has_warning("-Watimport-in-framework-header") 231 | #pragma clang diagnostic ignored "-Watimport-in-framework-header" 232 | #endif 233 | @import Foundation; 234 | @import ObjectiveC; 235 | @import StoreKit; 236 | #endif 237 | 238 | #endif 239 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 240 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 241 | #if __has_warning("-Wpragma-clang-attribute") 242 | # pragma clang diagnostic ignored "-Wpragma-clang-attribute" 243 | #endif 244 | #pragma clang diagnostic ignored "-Wunknown-pragmas" 245 | #pragma clang diagnostic ignored "-Wnullability" 246 | #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" 247 | 248 | #if __has_attribute(external_source_symbol) 249 | # pragma push_macro("any") 250 | # undef any 251 | # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SwiftyStoreKit",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) 252 | # pragma pop_macro("any") 253 | #endif 254 | 255 | #if defined(__OBJC__) 256 | @class SKProductsRequest; 257 | @class SKProductsResponse; 258 | @class SKRequest; 259 | 260 | SWIFT_CLASS("_TtC14SwiftyStoreKit24InAppProductQueryRequest") 261 | @interface InAppProductQueryRequest : NSObject 262 | - (void)productsRequest:(SKProductsRequest * _Nonnull)request didReceiveResponse:(SKProductsResponse * _Nonnull)response; 263 | - (void)requestDidFinish:(SKRequest * _Nonnull)request; 264 | - (void)request:(SKRequest * _Nonnull)request didFailWithError:(NSError * _Nonnull)error; 265 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 266 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 267 | @end 268 | 269 | 270 | SWIFT_CLASS("_TtC14SwiftyStoreKit26InAppReceiptRefreshRequest") 271 | @interface InAppReceiptRefreshRequest : NSObject 272 | - (void)requestDidFinish:(SKRequest * _Nonnull)request; 273 | - (void)request:(SKRequest * _Nonnull)request didFailWithError:(NSError * _Nonnull)error; 274 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 275 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 276 | @end 277 | 278 | 279 | SWIFT_CLASS("_TtC14SwiftyStoreKit23InAppReceiptVerificator") 280 | @interface InAppReceiptVerificator : NSObject 281 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 282 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 283 | @end 284 | 285 | @class SKPaymentQueue; 286 | @class SKPaymentTransaction; 287 | @class NSString; 288 | @class SKDownload; 289 | 290 | SWIFT_CLASS("_TtC14SwiftyStoreKit22PaymentQueueController") 291 | @interface PaymentQueueController : NSObject 292 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue updatedTransactions:(NSArray * _Nonnull)transactions; 293 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue didRevokeEntitlementsForProductIdentifiers:(NSArray * _Nonnull)productIdentifiers; 294 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue removedTransactions:(NSArray * _Nonnull)transactions; 295 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue restoreCompletedTransactionsFailedWithError:(NSError * _Nonnull)error; 296 | - (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue * _Nonnull)queue; 297 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue updatedDownloads:(NSArray * _Nonnull)downloads; 298 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 299 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 300 | @end 301 | 302 | 303 | SWIFT_CLASS("_TtC14SwiftyStoreKit22ProductsInfoController") 304 | @interface ProductsInfoController : NSObject 305 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 306 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 307 | @end 308 | 309 | 310 | 311 | 312 | @interface SKPaymentTransaction (SWIFT_EXTENSION(SwiftyStoreKit)) 313 | @property (nonatomic, readonly, copy) NSString * _Nonnull debugDescription; 314 | @end 315 | 316 | 317 | 318 | #endif 319 | #if defined(__cplusplus) 320 | #endif 321 | #if __has_attribute(external_source_symbol) 322 | # pragma clang attribute pop 323 | #endif 324 | #pragma clang diagnostic pop 325 | #endif 326 | 327 | #elif defined(__x86_64__) && __x86_64__ 328 | // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) 329 | #ifndef SWIFTYSTOREKIT_SWIFT_H 330 | #define SWIFTYSTOREKIT_SWIFT_H 331 | #pragma clang diagnostic push 332 | #pragma clang diagnostic ignored "-Wgcc-compat" 333 | 334 | #if !defined(__has_include) 335 | # define __has_include(x) 0 336 | #endif 337 | #if !defined(__has_attribute) 338 | # define __has_attribute(x) 0 339 | #endif 340 | #if !defined(__has_feature) 341 | # define __has_feature(x) 0 342 | #endif 343 | #if !defined(__has_warning) 344 | # define __has_warning(x) 0 345 | #endif 346 | 347 | #if __has_include() 348 | # include 349 | #endif 350 | 351 | #pragma clang diagnostic ignored "-Wduplicate-method-match" 352 | #pragma clang diagnostic ignored "-Wauto-import" 353 | #if defined(__OBJC__) 354 | #include 355 | #endif 356 | #if defined(__cplusplus) 357 | #include 358 | #include 359 | #include 360 | #else 361 | #include 362 | #include 363 | #include 364 | #endif 365 | 366 | #if !defined(SWIFT_TYPEDEFS) 367 | # define SWIFT_TYPEDEFS 1 368 | # if __has_include() 369 | # include 370 | # elif !defined(__cplusplus) 371 | typedef uint_least16_t char16_t; 372 | typedef uint_least32_t char32_t; 373 | # endif 374 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 375 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 376 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 377 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 378 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 379 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 380 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 381 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 382 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 383 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 384 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 385 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 386 | #endif 387 | 388 | #if !defined(SWIFT_PASTE) 389 | # define SWIFT_PASTE_HELPER(x, y) x##y 390 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 391 | #endif 392 | #if !defined(SWIFT_METATYPE) 393 | # define SWIFT_METATYPE(X) Class 394 | #endif 395 | #if !defined(SWIFT_CLASS_PROPERTY) 396 | # if __has_feature(objc_class_property) 397 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 398 | # else 399 | # define SWIFT_CLASS_PROPERTY(...) 400 | # endif 401 | #endif 402 | 403 | #if __has_attribute(objc_runtime_name) 404 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 405 | #else 406 | # define SWIFT_RUNTIME_NAME(X) 407 | #endif 408 | #if __has_attribute(swift_name) 409 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 410 | #else 411 | # define SWIFT_COMPILE_NAME(X) 412 | #endif 413 | #if __has_attribute(objc_method_family) 414 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 415 | #else 416 | # define SWIFT_METHOD_FAMILY(X) 417 | #endif 418 | #if __has_attribute(noescape) 419 | # define SWIFT_NOESCAPE __attribute__((noescape)) 420 | #else 421 | # define SWIFT_NOESCAPE 422 | #endif 423 | #if __has_attribute(ns_consumed) 424 | # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) 425 | #else 426 | # define SWIFT_RELEASES_ARGUMENT 427 | #endif 428 | #if __has_attribute(warn_unused_result) 429 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 430 | #else 431 | # define SWIFT_WARN_UNUSED_RESULT 432 | #endif 433 | #if __has_attribute(noreturn) 434 | # define SWIFT_NORETURN __attribute__((noreturn)) 435 | #else 436 | # define SWIFT_NORETURN 437 | #endif 438 | #if !defined(SWIFT_CLASS_EXTRA) 439 | # define SWIFT_CLASS_EXTRA 440 | #endif 441 | #if !defined(SWIFT_PROTOCOL_EXTRA) 442 | # define SWIFT_PROTOCOL_EXTRA 443 | #endif 444 | #if !defined(SWIFT_ENUM_EXTRA) 445 | # define SWIFT_ENUM_EXTRA 446 | #endif 447 | #if !defined(SWIFT_CLASS) 448 | # if __has_attribute(objc_subclassing_restricted) 449 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 450 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 451 | # else 452 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 453 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 454 | # endif 455 | #endif 456 | #if !defined(SWIFT_RESILIENT_CLASS) 457 | # if __has_attribute(objc_class_stub) 458 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) 459 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) 460 | # else 461 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) 462 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) 463 | # endif 464 | #endif 465 | 466 | #if !defined(SWIFT_PROTOCOL) 467 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 468 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 469 | #endif 470 | 471 | #if !defined(SWIFT_EXTENSION) 472 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 473 | #endif 474 | 475 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 476 | # if __has_attribute(objc_designated_initializer) 477 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 478 | # else 479 | # define OBJC_DESIGNATED_INITIALIZER 480 | # endif 481 | #endif 482 | #if !defined(SWIFT_ENUM_ATTR) 483 | # if defined(__has_attribute) && __has_attribute(enum_extensibility) 484 | # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) 485 | # else 486 | # define SWIFT_ENUM_ATTR(_extensibility) 487 | # endif 488 | #endif 489 | #if !defined(SWIFT_ENUM) 490 | # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 491 | # if __has_feature(generalized_swift_name) 492 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 493 | # else 494 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) 495 | # endif 496 | #endif 497 | #if !defined(SWIFT_UNAVAILABLE) 498 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 499 | #endif 500 | #if !defined(SWIFT_UNAVAILABLE_MSG) 501 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 502 | #endif 503 | #if !defined(SWIFT_AVAILABILITY) 504 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 505 | #endif 506 | #if !defined(SWIFT_WEAK_IMPORT) 507 | # define SWIFT_WEAK_IMPORT __attribute__((weak_import)) 508 | #endif 509 | #if !defined(SWIFT_DEPRECATED) 510 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 511 | #endif 512 | #if !defined(SWIFT_DEPRECATED_MSG) 513 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 514 | #endif 515 | #if __has_feature(attribute_diagnose_if_objc) 516 | # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) 517 | #else 518 | # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) 519 | #endif 520 | #if defined(__OBJC__) 521 | #if !defined(IBSegueAction) 522 | # define IBSegueAction 523 | #endif 524 | #endif 525 | #if !defined(SWIFT_EXTERN) 526 | # if defined(__cplusplus) 527 | # define SWIFT_EXTERN extern "C" 528 | # else 529 | # define SWIFT_EXTERN extern 530 | # endif 531 | #endif 532 | #if !defined(SWIFT_CALL) 533 | # define SWIFT_CALL __attribute__((swiftcall)) 534 | #endif 535 | #if defined(__cplusplus) 536 | #if !defined(SWIFT_NOEXCEPT) 537 | # define SWIFT_NOEXCEPT noexcept 538 | #endif 539 | #else 540 | #if !defined(SWIFT_NOEXCEPT) 541 | # define SWIFT_NOEXCEPT 542 | #endif 543 | #endif 544 | #if defined(__cplusplus) 545 | #if !defined(SWIFT_CXX_INT_DEFINED) 546 | #define SWIFT_CXX_INT_DEFINED 547 | namespace swift { 548 | using Int = ptrdiff_t; 549 | using UInt = size_t; 550 | } 551 | #endif 552 | #endif 553 | #if defined(__OBJC__) 554 | #if __has_feature(modules) 555 | #if __has_warning("-Watimport-in-framework-header") 556 | #pragma clang diagnostic ignored "-Watimport-in-framework-header" 557 | #endif 558 | @import Foundation; 559 | @import ObjectiveC; 560 | @import StoreKit; 561 | #endif 562 | 563 | #endif 564 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 565 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 566 | #if __has_warning("-Wpragma-clang-attribute") 567 | # pragma clang diagnostic ignored "-Wpragma-clang-attribute" 568 | #endif 569 | #pragma clang diagnostic ignored "-Wunknown-pragmas" 570 | #pragma clang diagnostic ignored "-Wnullability" 571 | #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" 572 | 573 | #if __has_attribute(external_source_symbol) 574 | # pragma push_macro("any") 575 | # undef any 576 | # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SwiftyStoreKit",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) 577 | # pragma pop_macro("any") 578 | #endif 579 | 580 | #if defined(__OBJC__) 581 | @class SKProductsRequest; 582 | @class SKProductsResponse; 583 | @class SKRequest; 584 | 585 | SWIFT_CLASS("_TtC14SwiftyStoreKit24InAppProductQueryRequest") 586 | @interface InAppProductQueryRequest : NSObject 587 | - (void)productsRequest:(SKProductsRequest * _Nonnull)request didReceiveResponse:(SKProductsResponse * _Nonnull)response; 588 | - (void)requestDidFinish:(SKRequest * _Nonnull)request; 589 | - (void)request:(SKRequest * _Nonnull)request didFailWithError:(NSError * _Nonnull)error; 590 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 591 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 592 | @end 593 | 594 | 595 | SWIFT_CLASS("_TtC14SwiftyStoreKit26InAppReceiptRefreshRequest") 596 | @interface InAppReceiptRefreshRequest : NSObject 597 | - (void)requestDidFinish:(SKRequest * _Nonnull)request; 598 | - (void)request:(SKRequest * _Nonnull)request didFailWithError:(NSError * _Nonnull)error; 599 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 600 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 601 | @end 602 | 603 | 604 | SWIFT_CLASS("_TtC14SwiftyStoreKit23InAppReceiptVerificator") 605 | @interface InAppReceiptVerificator : NSObject 606 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 607 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 608 | @end 609 | 610 | @class SKPaymentQueue; 611 | @class SKPaymentTransaction; 612 | @class NSString; 613 | @class SKDownload; 614 | 615 | SWIFT_CLASS("_TtC14SwiftyStoreKit22PaymentQueueController") 616 | @interface PaymentQueueController : NSObject 617 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue updatedTransactions:(NSArray * _Nonnull)transactions; 618 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue didRevokeEntitlementsForProductIdentifiers:(NSArray * _Nonnull)productIdentifiers; 619 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue removedTransactions:(NSArray * _Nonnull)transactions; 620 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue restoreCompletedTransactionsFailedWithError:(NSError * _Nonnull)error; 621 | - (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue * _Nonnull)queue; 622 | - (void)paymentQueue:(SKPaymentQueue * _Nonnull)queue updatedDownloads:(NSArray * _Nonnull)downloads; 623 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 624 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 625 | @end 626 | 627 | 628 | SWIFT_CLASS("_TtC14SwiftyStoreKit22ProductsInfoController") 629 | @interface ProductsInfoController : NSObject 630 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 631 | + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); 632 | @end 633 | 634 | 635 | 636 | 637 | @interface SKPaymentTransaction (SWIFT_EXTENSION(SwiftyStoreKit)) 638 | @property (nonatomic, readonly, copy) NSString * _Nonnull debugDescription; 639 | @end 640 | 641 | 642 | 643 | #endif 644 | #if defined(__cplusplus) 645 | #endif 646 | #if __has_attribute(external_source_symbol) 647 | # pragma clang attribute pop 648 | #endif 649 | #pragma clang diagnostic pop 650 | #endif 651 | 652 | #else 653 | #error unsupported Swift architecture 654 | #endif 655 | --------------------------------------------------------------------------------