iosMain.com.revenuecat.purchases.kmp.mappings.Offerings.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.Offerings
import com.revenuecat.purchases.kmp.mappings.ktx.mapEntries
import cocoapods.PurchasesHybridCommon.RCOffering as IosOffering
import cocoapods.PurchasesHybridCommon.RCOfferings as IosOfferings
public fun IosOfferings.toOfferings(): Offerings =
Offerings(
current = current()?.toOffering(),
all = all().mapEntries { (offeringId, offering) ->
offeringId as String to (offering as IosOffering).toOffering()
}
)