RxStoreKit

main

Reactive extensions of StoreKit(In-App purchase)
453jerry/RxStoreKit

RxStoreKit

swift platform
Reactive extensions of StoreKit

How to use

Request SKProduct

Create observable sequence of responses for SKProductRequest and subscribe it

SKProduct.rx.request(with: ["xxxxx"])
    .subscribe(onNext: { response in
        let products = response.products
    })
    .dispose()

or

let request = SKProductsRequest.init(productIdentifiers: ["product_id"])
request.rx.response.subscribe { event in
    switch event {
    case .next(let response): 
        let products = response.products
    default:
        return
    }
}
.dispose()

Subscribe update payment transactons

 SKPaymentQueue.default().rx.updatedTransaction
    .subscribe(onNext: { transaction in
        // Do what you want
    })
    .dispose()

Subscribe product identifiers with revoked entitlements

paymentQueue.rx.productIdentifiersWithRevokedEntitlements
    .subscribe { productIdentifier in
        // Do what you want
    }

Description

  • Swift Tools 5.4.0
View More Packages from this Author

Dependencies

Last updated: Sun Feb 05 2023 01:14:06 GMT-0500 (GMT-05:00)