react-native-purchases-ui 10.12.2 → 10.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNPaywalls.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/revenuecat/purchases/react/ui/BasePaywallViewManager.kt +3 -122
- package/android/src/main/java/com/revenuecat/purchases/react/ui/PaywallEventListener.kt +50 -0
- package/android/src/main/java/com/revenuecat/purchases/react/ui/RNPaywallsModule.kt +60 -12
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/{OnInteractionEvent.kt → PaywallViewEvent.kt} +8 -9
- package/ios/PaywallViewManager.m +1 -1
- package/ios/PaywallViewWrapper.h +3 -0
- package/ios/PaywallViewWrapper.m +38 -83
- package/ios/RCPaywallFooterViewManager.m +1 -1
- package/ios/RNPaywallEventForwarder.h +26 -0
- package/ios/RNPaywallEventForwarder.m +95 -0
- package/ios/RNPaywalls.h +2 -0
- package/ios/RNPaywalls.m +75 -1
- package/lib/commonjs/index.js +103 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/preview/nativeModules.js +2 -2
- package/lib/commonjs/preview/nativeModules.js.map +1 -1
- package/lib/module/index.js +103 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/preview/nativeModules.js +2 -2
- package/lib/module/preview/nativeModules.js.map +1 -1
- package/lib/typescript/src/index.d.ts +24 -8
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/preview/nativeModules.d.ts +2 -2
- package/lib/typescript/src/preview/nativeModules.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.tsx +87 -10
- package/src/preview/nativeModules.ts +6 -0
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnPurchaseCancelledEvent.kt +0 -13
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnPurchaseCompletedEvent.kt +0 -18
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnPurchaseErrorEvent.kt +0 -14
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnPurchasePackageInitiatedEvent.kt +0 -24
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnPurchaseStartedEvent.kt +0 -16
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnRestoreCompletedEvent.kt +0 -14
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnRestoreErrorEvent.kt +0 -14
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnRestoreStartedEvent.kt +0 -13
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnUrlOpenedEvent.kt +0 -21
- package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnWebCheckoutOpenedEvent.kt +0 -13
package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnPurchaseCompletedEvent.kt
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
package com.revenuecat.purchases.react.ui.events
|
|
2
|
-
|
|
3
|
-
import com.revenuecat.purchases.react.ui.PaywallEventKey
|
|
4
|
-
import com.revenuecat.purchases.react.ui.PaywallEventName
|
|
5
|
-
|
|
6
|
-
internal class OnPurchaseCompletedEvent(
|
|
7
|
-
surfaceId: Int,
|
|
8
|
-
viewTag: Int,
|
|
9
|
-
private val customerInfo: Map<String, Any?>,
|
|
10
|
-
private val storeTransaction: Map<String, Any?>
|
|
11
|
-
) : PaywallEvent<OnPurchaseCompletedEvent>(surfaceId, viewTag) {
|
|
12
|
-
override fun getPaywallEventName() = PaywallEventName.ON_PURCHASE_COMPLETED
|
|
13
|
-
|
|
14
|
-
override fun getPayload() = mapOf(
|
|
15
|
-
PaywallEventKey.CUSTOMER_INFO to customerInfo,
|
|
16
|
-
PaywallEventKey.STORE_TRANSACTION to storeTransaction
|
|
17
|
-
)
|
|
18
|
-
}
|
package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnPurchaseErrorEvent.kt
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
package com.revenuecat.purchases.react.ui.events
|
|
2
|
-
|
|
3
|
-
import com.revenuecat.purchases.react.ui.PaywallEventKey
|
|
4
|
-
import com.revenuecat.purchases.react.ui.PaywallEventName
|
|
5
|
-
|
|
6
|
-
internal class OnPurchaseErrorEvent(
|
|
7
|
-
surfaceId: Int,
|
|
8
|
-
viewTag: Int,
|
|
9
|
-
private val error: Map<String, Any?>
|
|
10
|
-
) : PaywallEvent<OnPurchaseErrorEvent>(surfaceId, viewTag) {
|
|
11
|
-
override fun getPaywallEventName() = PaywallEventName.ON_PURCHASE_ERROR
|
|
12
|
-
|
|
13
|
-
override fun getPayload() = mapOf(PaywallEventKey.ERROR to error)
|
|
14
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
package com.revenuecat.purchases.react.ui.events
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.WritableMap
|
|
4
|
-
import com.revenuecat.purchases.react.ui.PaywallEventKey
|
|
5
|
-
import com.revenuecat.purchases.react.ui.PaywallEventName
|
|
6
|
-
|
|
7
|
-
internal class OnPurchasePackageInitiatedEvent(
|
|
8
|
-
surfaceId: Int,
|
|
9
|
-
viewTag: Int,
|
|
10
|
-
private val packageMap: Map<String, Any?>,
|
|
11
|
-
private val requestId: String,
|
|
12
|
-
) : PaywallEvent<OnPurchasePackageInitiatedEvent>(surfaceId, viewTag) {
|
|
13
|
-
override fun getPaywallEventName() = PaywallEventName.ON_PURCHASE_PACKAGE_INITIATED
|
|
14
|
-
|
|
15
|
-
override fun getPayload() = mapOf(
|
|
16
|
-
PaywallEventKey.PACKAGE to packageMap,
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
override fun getEventData(): WritableMap {
|
|
20
|
-
return super.getEventData().apply {
|
|
21
|
-
putString(PaywallEventKey.REQUEST_ID.key, requestId)
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnPurchaseStartedEvent.kt
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
package com.revenuecat.purchases.react.ui.events
|
|
2
|
-
|
|
3
|
-
import com.revenuecat.purchases.react.ui.PaywallEventKey
|
|
4
|
-
import com.revenuecat.purchases.react.ui.PaywallEventName
|
|
5
|
-
|
|
6
|
-
internal class OnPurchaseStartedEvent(
|
|
7
|
-
surfaceId: Int,
|
|
8
|
-
viewTag: Int,
|
|
9
|
-
private val packageMap: Map<String, Any?>
|
|
10
|
-
) : PaywallEvent<OnPurchaseStartedEvent>(surfaceId, viewTag) {
|
|
11
|
-
override fun getPaywallEventName() = PaywallEventName.ON_PURCHASE_STARTED
|
|
12
|
-
|
|
13
|
-
override fun getPayload() = mapOf(
|
|
14
|
-
PaywallEventKey.PACKAGE to packageMap,
|
|
15
|
-
)
|
|
16
|
-
}
|
package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnRestoreCompletedEvent.kt
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
package com.revenuecat.purchases.react.ui.events
|
|
2
|
-
|
|
3
|
-
import com.revenuecat.purchases.react.ui.PaywallEventKey
|
|
4
|
-
import com.revenuecat.purchases.react.ui.PaywallEventName
|
|
5
|
-
|
|
6
|
-
internal class OnRestoreCompletedEvent(
|
|
7
|
-
surfaceId: Int,
|
|
8
|
-
viewTag: Int,
|
|
9
|
-
private val customerInfo: Map<String, Any?>,
|
|
10
|
-
) : PaywallEvent<OnRestoreCompletedEvent>(surfaceId, viewTag) {
|
|
11
|
-
override fun getPaywallEventName() = PaywallEventName.ON_RESTORE_COMPLETED
|
|
12
|
-
|
|
13
|
-
override fun getPayload() = mapOf(PaywallEventKey.CUSTOMER_INFO to customerInfo)
|
|
14
|
-
}
|
package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnRestoreErrorEvent.kt
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
package com.revenuecat.purchases.react.ui.events
|
|
2
|
-
|
|
3
|
-
import com.revenuecat.purchases.react.ui.PaywallEventKey
|
|
4
|
-
import com.revenuecat.purchases.react.ui.PaywallEventName
|
|
5
|
-
|
|
6
|
-
internal class OnRestoreErrorEvent(
|
|
7
|
-
surfaceId: Int,
|
|
8
|
-
viewTag: Int,
|
|
9
|
-
private val error: Map<String, Any?>
|
|
10
|
-
) : PaywallEvent<OnRestoreErrorEvent>(surfaceId, viewTag) {
|
|
11
|
-
override fun getPaywallEventName() = PaywallEventName.ON_RESTORE_ERROR
|
|
12
|
-
|
|
13
|
-
override fun getPayload() = mapOf(PaywallEventKey.ERROR to error)
|
|
14
|
-
}
|
package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnRestoreStartedEvent.kt
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
package com.revenuecat.purchases.react.ui.events
|
|
2
|
-
|
|
3
|
-
import com.revenuecat.purchases.react.ui.PaywallEventKey
|
|
4
|
-
import com.revenuecat.purchases.react.ui.PaywallEventName
|
|
5
|
-
|
|
6
|
-
internal class OnRestoreStartedEvent(
|
|
7
|
-
surfaceId: Int,
|
|
8
|
-
viewTag: Int,
|
|
9
|
-
) : PaywallEvent<OnRestoreStartedEvent>(surfaceId, viewTag) {
|
|
10
|
-
override fun getPaywallEventName() = PaywallEventName.ON_RESTORE_STARTED
|
|
11
|
-
|
|
12
|
-
override fun getPayload(): Map<PaywallEventKey, Map<String, Any?>> = emptyMap()
|
|
13
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
package com.revenuecat.purchases.react.ui.events
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.WritableMap
|
|
4
|
-
import com.revenuecat.purchases.react.ui.PaywallEventKey
|
|
5
|
-
import com.revenuecat.purchases.react.ui.PaywallEventName
|
|
6
|
-
|
|
7
|
-
internal class OnUrlOpenedEvent(
|
|
8
|
-
surfaceId: Int,
|
|
9
|
-
viewTag: Int,
|
|
10
|
-
private val url: String,
|
|
11
|
-
) : PaywallEvent<OnUrlOpenedEvent>(surfaceId, viewTag) {
|
|
12
|
-
override fun getPaywallEventName() = PaywallEventName.ON_URL_OPENED
|
|
13
|
-
|
|
14
|
-
override fun getPayload(): Map<PaywallEventKey, Map<String, Any?>> = emptyMap()
|
|
15
|
-
|
|
16
|
-
override fun getEventData(): WritableMap {
|
|
17
|
-
return super.getEventData().apply {
|
|
18
|
-
putString(PaywallEventKey.URL.key, url)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
package/android/src/main/java/com/revenuecat/purchases/react/ui/events/OnWebCheckoutOpenedEvent.kt
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
package com.revenuecat.purchases.react.ui.events
|
|
2
|
-
|
|
3
|
-
import com.revenuecat.purchases.react.ui.PaywallEventKey
|
|
4
|
-
import com.revenuecat.purchases.react.ui.PaywallEventName
|
|
5
|
-
|
|
6
|
-
internal class OnWebCheckoutOpenedEvent(
|
|
7
|
-
surfaceId: Int,
|
|
8
|
-
viewTag: Int,
|
|
9
|
-
) : PaywallEvent<OnWebCheckoutOpenedEvent>(surfaceId, viewTag) {
|
|
10
|
-
override fun getPaywallEventName() = PaywallEventName.ON_WEB_CHECKOUT_OPENED
|
|
11
|
-
|
|
12
|
-
override fun getPayload(): Map<PaywallEventKey, Map<String, Any?>> = emptyMap()
|
|
13
|
-
}
|