Skip to content

Commit 043d458

Browse files
committed
Fix lint issue
1 parent 4618f7e commit 043d458

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

app/src/main/java/com/superwall/superapp/MainApplication.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.superwall.superapp
22

3+
import android.annotation.SuppressLint
34
import android.app.Activity
45
import android.os.StrictMode
56
import android.os.StrictMode.ThreadPolicy
@@ -36,6 +37,7 @@ class MainApplication :
3637
SuperwallDelegate {
3738
var activity: WeakReference<Activity>? = null
3839

40+
@SuppressLint("NewApi")
3941
override fun onCreate() {
4042
super.onCreate()
4143
StrictMode.setThreadPolicy(

example/app/src/revenuecat/java/com/superwall/superapp/RevenueCatPurchaseController.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import com.superwall.sdk.delegate.PurchaseResult
2626
import com.superwall.sdk.delegate.RestorationResult
2727
import com.superwall.sdk.delegate.subscription_controller.PurchaseController
2828
import com.superwall.sdk.models.entitlements.Entitlement
29-
import com.superwall.sdk.models.entitlements.EntitlementStatus
29+
import com.superwall.sdk.models.entitlements.SubscriptionStatus
3030
import kotlinx.coroutines.CompletableDeferred
3131

3232
suspend fun Purchases.awaitProducts(productIds: List<String>): List<StoreProduct> {
@@ -125,16 +125,16 @@ class RevenueCatPurchaseController(
125125
// Refetch the customer info on load
126126
Purchases.sharedInstance.getCustomerInfoWith {
127127
if (hasAnyActiveEntitlements(it)) {
128-
setEntitlementStatus(
129-
EntitlementStatus.Active(
128+
setSubscriptionStatus(
129+
SubscriptionStatus.Active(
130130
it.entitlements.active
131131
.map {
132132
Entitlement(it.key, Entitlement.Type.SERVICE_LEVEL)
133133
}.toSet(),
134134
),
135135
)
136136
} else {
137-
setEntitlementStatus(EntitlementStatus.Inactive)
137+
setSubscriptionStatus(SubscriptionStatus.Inactive)
138138
}
139139
}
140140
}
@@ -144,16 +144,16 @@ class RevenueCatPurchaseController(
144144
*/
145145
override fun onReceived(customerInfo: CustomerInfo) {
146146
if (hasAnyActiveEntitlements(customerInfo)) {
147-
setEntitlementStatus(
148-
EntitlementStatus.Active(
147+
setSubscriptionStatus(
148+
SubscriptionStatus.Active(
149149
customerInfo.entitlements.active
150150
.map {
151151
Entitlement(it.key, Entitlement.Type.SERVICE_LEVEL)
152152
}.toSet(),
153153
),
154154
)
155155
} else {
156-
setEntitlementStatus(EntitlementStatus.Inactive)
156+
setSubscriptionStatus(SubscriptionStatus.Inactive)
157157
}
158158
}
159159

@@ -288,9 +288,9 @@ class RevenueCatPurchaseController(
288288
return entitlements.isNotEmpty()
289289
}
290290

291-
private fun setEntitlementStatus(entitlementStatus: EntitlementStatus) {
291+
private fun setSubscriptionStatus(subscriptionStatus: SubscriptionStatus) {
292292
if (Superwall.initialized) {
293-
Superwall.instance.setEntitlementStatus(entitlementStatus)
293+
Superwall.instance.setSubscriptionStatus(subscriptionStatus)
294294
}
295295
}
296296
}

0 commit comments

Comments
 (0)