@@ -26,7 +26,7 @@ import com.superwall.sdk.delegate.PurchaseResult
26
26
import com.superwall.sdk.delegate.RestorationResult
27
27
import com.superwall.sdk.delegate.subscription_controller.PurchaseController
28
28
import com.superwall.sdk.models.entitlements.Entitlement
29
- import com.superwall.sdk.models.entitlements.EntitlementStatus
29
+ import com.superwall.sdk.models.entitlements.SubscriptionStatus
30
30
import kotlinx.coroutines.CompletableDeferred
31
31
32
32
suspend fun Purchases.awaitProducts (productIds : List <String >): List <StoreProduct > {
@@ -125,16 +125,16 @@ class RevenueCatPurchaseController(
125
125
// Refetch the customer info on load
126
126
Purchases .sharedInstance.getCustomerInfoWith {
127
127
if (hasAnyActiveEntitlements(it)) {
128
- setEntitlementStatus (
129
- EntitlementStatus .Active (
128
+ setSubscriptionStatus (
129
+ SubscriptionStatus .Active (
130
130
it.entitlements.active
131
131
.map {
132
132
Entitlement (it.key, Entitlement .Type .SERVICE_LEVEL )
133
133
}.toSet(),
134
134
),
135
135
)
136
136
} else {
137
- setEntitlementStatus( EntitlementStatus .Inactive )
137
+ setSubscriptionStatus( SubscriptionStatus .Inactive )
138
138
}
139
139
}
140
140
}
@@ -144,16 +144,16 @@ class RevenueCatPurchaseController(
144
144
*/
145
145
override fun onReceived (customerInfo : CustomerInfo ) {
146
146
if (hasAnyActiveEntitlements(customerInfo)) {
147
- setEntitlementStatus (
148
- EntitlementStatus .Active (
147
+ setSubscriptionStatus (
148
+ SubscriptionStatus .Active (
149
149
customerInfo.entitlements.active
150
150
.map {
151
151
Entitlement (it.key, Entitlement .Type .SERVICE_LEVEL )
152
152
}.toSet(),
153
153
),
154
154
)
155
155
} else {
156
- setEntitlementStatus( EntitlementStatus .Inactive )
156
+ setSubscriptionStatus( SubscriptionStatus .Inactive )
157
157
}
158
158
}
159
159
@@ -288,9 +288,9 @@ class RevenueCatPurchaseController(
288
288
return entitlements.isNotEmpty()
289
289
}
290
290
291
- private fun setEntitlementStatus ( entitlementStatus : EntitlementStatus ) {
291
+ private fun setSubscriptionStatus ( subscriptionStatus : SubscriptionStatus ) {
292
292
if (Superwall .initialized) {
293
- Superwall .instance.setEntitlementStatus(entitlementStatus )
293
+ Superwall .instance.setSubscriptionStatus(subscriptionStatus )
294
294
}
295
295
}
296
296
}
0 commit comments