Skip to content

Instantly share code, notes, and snippets.

View EllinaKuznetcova's full-sized avatar

Ellina Kuznetcova EllinaKuznetcova

View GitHub Profile
func purchaseProduct(productType: ProductType) {
guard let product = self.products.filter({$0.productIdentifier == productType.rawValue}).first else {
self.delegate?.inAppLoadingFailed(error: InAppErrors.noProductsAvailable)
return
}
let payment = SKMutablePayment(product: product)
SKPaymentQueue.default().add(payment)
}
class RTSubscriptionResponse: Mappable {
var expirationDate: Date?
var isTrial: Bool?
var productId: String?
required convenience init?(map: Map) {
self.init()
}
func restoreSubscription() {
SKPaymentQueue.default().restoreCompletedTransactions()
self.delegate?.inAppLoadingStarted()
}
func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: Swift.Error) {
self.delegate?.inAppLoadingFailed(error: error)
}
{
"Booking": {
"BookingUuid": "cee3384c-3155-4684-ad06-b9a1ee134e5b",
"Name": "ellinaclient",
"Start": "2022-06-16T12:00:00Z",
"End": "2022-06-16T13:00:00Z",
"Machines": [
"3b8eb5ff-e9ae-4d42-9e3b-7c63d72a1dc3"
],
"WithCoupons": false,
const appBridge = {
initialize: function () {
if (window.location.host.indexOf('web-demo') !== -1)
return;
console.log('initialize appBridge');
appBridge.parseDom();
window.addEventListener("message", (event) => {