react-native-nami-sdk 3.2.2-3 → 3.2.2-4
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/README.md
CHANGED
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
# React Native Bridge for the Nami SDK
|
|
4
4
|
|
|
5
|
-
Nami
|
|
5
|
+
Nami ML gives you everything you need to power your paywall, streamline subscription management, and drive revenue growth through instantly deployable paywalls, precise targeting and segmentation, and enterprise-grade security and scaleability.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- No IAP code to write.
|
|
9
|
-
- Focus on your app experience.
|
|
10
|
-
- All edge cases are handled and no server is required.
|
|
11
|
-
- Includes is powerful built-in paywalls templates, built with native SwiftUI and Jetpack Compose
|
|
12
|
-
- Update paywalls easily using a browser-based paywall CMS.
|
|
13
|
-
- Conduct paywall A/B tests, to improve your conversion rate.
|
|
14
|
-
- Robust subscription analytics, webhooks, and much more.
|
|
7
|
+
Go beyond basic IAP and focus on results with:
|
|
15
8
|
|
|
16
|
-
|
|
9
|
+
* Library of smart paywall templates to choose from, implemented natively
|
|
10
|
+
* No-code paywall creator so you can launch a new paywall design instantly, without submitting an app update
|
|
11
|
+
* Experimentation engine to run paywall A/B tests so you can improve your conversion rates
|
|
12
|
+
* Built-in IAP & subscription management and analytics, so you don't need another solution
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
Nami is simple adopt while giving you the tools you need to improve revenue. Our free tier is generous, and gives you everything you need to get started. [Sign up for a free account](https://app.namiml.com/join/)
|
|
15
|
+
|
|
16
|
+
Get started by heading over to our [quick start guide](https://learn.namiml.com/public-docs/get-started/quickstart-guide)
|
|
19
17
|
|
|
20
18
|
## Getting started with React Native and Nami
|
|
21
19
|
|
|
@@ -21,7 +21,7 @@ class NamiCampaignManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
21
21
|
const val CAMPAIGN_LABEL = "campaignLabel"
|
|
22
22
|
const val PAYWALL_ID = "paywallId"
|
|
23
23
|
const val ACTION = "action"
|
|
24
|
-
const val
|
|
24
|
+
const val SKU = "sku"
|
|
25
25
|
const val PURCHASE_ERROR = "purchaseError"
|
|
26
26
|
const val PURCHASES = "purchases"
|
|
27
27
|
const val CAMPAIGN_NAME = "campaignName"
|
|
@@ -153,7 +153,6 @@ class NamiCampaignManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
153
153
|
actionCallback: Callback,
|
|
154
154
|
) {
|
|
155
155
|
val actionString = paywallEvent.action.toString()
|
|
156
|
-
val skuString = paywallEvent.sku?.skuId ?: ""
|
|
157
156
|
|
|
158
157
|
val purchasesArray = createPurchaseArray(paywallEvent.purchases)
|
|
159
158
|
|
|
@@ -163,7 +162,6 @@ class NamiCampaignManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
163
162
|
putString(CAMPAIGN_LABEL, paywallEvent.campaignLabel ?: "")
|
|
164
163
|
putString(PAYWALL_ID, paywallEvent.paywallId)
|
|
165
164
|
putString(ACTION, actionString)
|
|
166
|
-
putString(SKU_ID, skuString)
|
|
167
165
|
putString(PURCHASE_ERROR, paywallEvent.purchaseError ?: "")
|
|
168
166
|
putArray(PURCHASES, purchasesArray)
|
|
169
167
|
putString(CAMPAIGN_NAME, paywallEvent.campaignName ?: "")
|
|
@@ -175,6 +173,17 @@ class NamiCampaignManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
175
173
|
putString(DEEP_LINK_URL, paywallEvent.deeplinkUrl ?: "")
|
|
176
174
|
}
|
|
177
175
|
|
|
176
|
+
if (paywallEvent.sku != null) {
|
|
177
|
+
val skuMap =
|
|
178
|
+
Arguments.createMap().apply {
|
|
179
|
+
putString("id", paywallEvent.sku?.id ?: "")
|
|
180
|
+
putString("skuId", paywallEvent.sku?.skuId ?: "")
|
|
181
|
+
putString("name", paywallEvent.sku?.name ?: "")
|
|
182
|
+
putString("type", paywallEvent.sku?.type.toString().lowercase())
|
|
183
|
+
}
|
|
184
|
+
resultMap.putMap(SKU, skuMap)
|
|
185
|
+
}
|
|
186
|
+
|
|
178
187
|
if (paywallEvent.componentChange != null) {
|
|
179
188
|
val componentChangeMap =
|
|
180
189
|
Arguments.createMap().apply {
|
|
@@ -106,6 +106,15 @@ class RNNamiCampaignManager: RCTEventEmitter {
|
|
|
106
106
|
|
|
107
107
|
let dictionaries = paywallEvent.purchases.map { purchase in RNNamiPurchaseManager.purchaseToPurchaseDict(purchase) }
|
|
108
108
|
|
|
109
|
+
var skuDict: [String: Any?] = [:]
|
|
110
|
+
|
|
111
|
+
if let sku = paywallEvent.sku {
|
|
112
|
+
skuDict["id"] = sku.id
|
|
113
|
+
skuDict["name"] = sku.name
|
|
114
|
+
skuDict["skuId"] = sku.skuId
|
|
115
|
+
skuDict["type"] = sku.type.description
|
|
116
|
+
}
|
|
117
|
+
|
|
109
118
|
var componentChange: [String: Any?] = [:]
|
|
110
119
|
|
|
111
120
|
if let eventComponentChange = paywallEvent.componentChange {
|
|
@@ -137,7 +146,7 @@ class RNNamiCampaignManager: RCTEventEmitter {
|
|
|
137
146
|
"segmentId": paywallEvent.segmentId,
|
|
138
147
|
"externalSegmentId": paywallEvent.externalSegmentId,
|
|
139
148
|
"action": actionString,
|
|
140
|
-
"
|
|
149
|
+
"sku": skuDict,
|
|
141
150
|
"purchaseError": errorSting,
|
|
142
151
|
"purchases": dictionaries,
|
|
143
152
|
"deeplinkUrl": paywallEvent.deeplinkUrl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nami-sdk",
|
|
3
|
-
"version": "3.2.2-
|
|
3
|
+
"version": "3.2.2-4",
|
|
4
4
|
"description": "React Native Module for Nami - Easy subscriptions & in-app purchases, with powerful built-in paywalls and A/B testing.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "index.d.ts",
|