Handle in-app purchases in swift in a convenient way.
InAppPurchases covers all the basic aspects of in-app purchases in swift including purchase of a product, restore, request products, validation of receipt, auto parsing of receipt validation response and managing subscription on App Store. All the functions are available with callbacks.
InAppPurchases is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'InAppPurchases'
Create an instance of InAppPurchase Module
let inAppPurchases = InAppPurchases()
inAppPurchases.purchaseProduct(productIdentifier: "Your Product ID") { success in
print(success)
}
inAppPurchases.restorePurchase() { success in
print(success)
}
inAppPurchases.requestProducts([Your_ProductIDs]) { products in
for product in products {
print(product.localizedPrice())
}
}
inAppPurchases.isProductPurchased("Your Product ID", appSharedSecret: "Your app shared secret") { purchased in
print(purchased)
}
inAppPurchases.manageSubscriptionsOnAppStore()
Umar Awais, [email protected]
InAppPurchases is available under the MIT license. See the LICENSE file for more info.