Latest 0.6.1
Homepage https://github.com/dclelland/StoreKitClient
License MIT
Platforms ios 8.0
Dependencies PromiseKit
Authors

Simple PromiseKit based client for Apple’s StoreKit IAP API.

Largely based on the existing PromiseKit/StoreKit wrapper.

Dependencies

Examples

Get products:

let productIdentifiers: Set<String> = /* ... get product identifers */
StoreKitClient.getProducts(productIdentifiers: productIdentifiers).then { productsResponse in
    // Handle products...
}.catch { error in
    // Handle exception...
}

Make a payment:

let product: SKProduct = /* ... get product from `StoreKitClient.getProducts` */
let payment: SKPayment = SKPayment(product: product)
StoreKitClient.getTransaction(payment: payment).then { transaction in
    // Check `transaction.transactionState`...
}.catch { error in
    switch ((error as NSError).domain, (error as NSError).code) {
    case (SKErrorDomain, SKError.paymentCancelled.rawValue):
        // User cancelled, don't show an error...
    default:
        // Handle exception...
    }
}

Get completed transactions:

StoreKitClient.getTransactions().then { transactions in
    // Handle completed transactions...
}.catch { error in
    // Handle exception...
}

Refresh the receipt:

StoreKitClient.getReceipt().then { receipt in
    // Check `Bundle.main.appStoreReceiptURL`...
}.catch { error in
    // Handle exception...
}

Latest podspec

{
    "name": "StoreKitClient",
    "version": "0.6.1",
    "summary": "Simple PromiseKit based client for Apple's StoreKit IAP API.",
    "homepage": "https://github.com/dclelland/StoreKitClient",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Daniel Clelland": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dclelland/StoreKitClient.git",
        "tag": "0.6.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.2",
    "ios": {
        "source_files": "Sources/**/*.swift"
    },
    "dependencies": {
        "PromiseKit": [
            "~> 6.4.0"
        ]
    }
}

Pin It on Pinterest

Share This