iosMain.com.revenuecat.purchases.kmp.mappings.PromotionalOffer.ios.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of purchases-kmp-mappings Show documentation
Show all versions of purchases-kmp-mappings Show documentation
Mobile subscriptions in hours, not months.
package com.revenuecat.purchases.kmp.mappings
import com.revenuecat.purchases.kmp.models.PromotionalOffer
import com.revenuecat.purchases.kmp.models.StoreProductDiscount
import cocoapods.PurchasesHybridCommon.RCPromotionalOffer as NativeIosPromotionalOffer
public fun NativeIosPromotionalOffer.toPromotionalOffer(): PromotionalOffer =
IosPromotionalOffer(this)
public fun PromotionalOffer.toIosPromotionalOffer(): NativeIosPromotionalOffer = (this as IosPromotionalOffer).wrapped
private class IosPromotionalOffer(val wrapped: NativeIosPromotionalOffer) : PromotionalOffer {
override val discount: StoreProductDiscount =
wrapped.discount().toStoreProductDiscount()
}