react-native-nami-sdk 3.0.24 → 3.0.25
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/android/build.gradle +1 -1
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +1 -1
- package/android/src/main/java/com/nami/reactlibrary/NamiCampaignManagerBridge.kt +23 -64
- package/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +1 -1
- package/android/src/main/java/com/nami/reactlibrary/NamiUtil.kt +1 -2
- package/ios/Nami.m +1 -1
- package/package.json +1 -1
- package/react-native-nami-sdk.podspec +1 -1
package/android/build.gradle
CHANGED
|
@@ -84,7 +84,7 @@ dependencies {
|
|
|
84
84
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
85
85
|
|
|
86
86
|
implementation 'com.github.jeziellago:compose-markdown:0.3.0'
|
|
87
|
-
implementation "com.namiml:sdk-android:3.0
|
|
87
|
+
implementation "com.namiml:sdk-android:3.1.0"
|
|
88
88
|
|
|
89
89
|
implementation 'com.facebook.react:react-native:+' // From node_modules
|
|
90
90
|
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
|
|
@@ -115,7 +115,7 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
115
115
|
} else {
|
|
116
116
|
Arguments.createArray()
|
|
117
117
|
}
|
|
118
|
-
val settingsList = mutableListOf("extendedClientInfo:react-native:3.0.
|
|
118
|
+
val settingsList = mutableListOf("extendedClientInfo:react-native:3.0.25")
|
|
119
119
|
namiCommandsReact?.toArrayList()?.filterIsInstance<String>()?.let { commandsFromReact ->
|
|
120
120
|
settingsList.addAll(commandsFromReact)
|
|
121
121
|
}
|
|
@@ -10,9 +10,8 @@ import com.namiml.billing.NamiPurchase
|
|
|
10
10
|
import com.namiml.campaign.LaunchCampaignResult
|
|
11
11
|
import com.namiml.campaign.NamiCampaign
|
|
12
12
|
import com.namiml.campaign.NamiCampaignManager
|
|
13
|
-
import com.namiml.paywall.NamiSKU
|
|
14
|
-
import com.namiml.paywall.model.NamiPaywallAction
|
|
15
13
|
import com.namiml.paywall.model.PaywallLaunchContext
|
|
14
|
+
import com.namiml.paywall.model.NamiPaywallEvent
|
|
16
15
|
|
|
17
16
|
class NamiCampaignManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
18
17
|
ReactContextBaseJavaModule(reactContext), ActivityEventListener {
|
|
@@ -92,42 +91,16 @@ class NamiCampaignManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
92
91
|
} else {
|
|
93
92
|
paywallLaunchContext = PaywallLaunchContext(null, customAttributes)
|
|
94
93
|
}
|
|
95
|
-
|
|
96
94
|
}
|
|
97
95
|
|
|
98
96
|
if (theActivity != null) {
|
|
99
97
|
reactApplicationContext.runOnUiQueueThread {
|
|
100
98
|
val paywallActionCallback = {
|
|
101
|
-
|
|
102
|
-
campaignName: String?,
|
|
103
|
-
campaignType: String?,
|
|
104
|
-
campaignLabel: String?,
|
|
105
|
-
campaignUrl: String?,
|
|
106
|
-
paywallId: String,
|
|
107
|
-
paywallName: String?,
|
|
108
|
-
segmentId: String?,
|
|
109
|
-
externalSegmentId: String?,
|
|
110
|
-
action: NamiPaywallAction,
|
|
111
|
-
sku: NamiSKU?,
|
|
112
|
-
purchaseError: String?,
|
|
113
|
-
purchases: List<NamiPurchase>?,
|
|
114
|
-
deeplinkUrl: String? ->
|
|
99
|
+
paywallEvent: NamiPaywallEvent ->
|
|
115
100
|
handlePaywallCallback(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
campaignLabel,
|
|
120
|
-
campaignUrl,
|
|
121
|
-
paywallId,
|
|
122
|
-
paywallName,
|
|
123
|
-
segmentId,
|
|
124
|
-
externalSegmentId,
|
|
125
|
-
action,
|
|
126
|
-
sku,
|
|
127
|
-
purchaseError,
|
|
128
|
-
purchases,
|
|
129
|
-
deeplinkUrl,
|
|
130
|
-
actionCallback)
|
|
101
|
+
paywallEvent,
|
|
102
|
+
actionCallback,
|
|
103
|
+
)
|
|
131
104
|
}
|
|
132
105
|
|
|
133
106
|
val uriObject: Uri? = if (withUrl != null) Uri.parse(withUrl) else null
|
|
@@ -154,48 +127,34 @@ class NamiCampaignManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
154
127
|
}
|
|
155
128
|
}
|
|
156
129
|
}
|
|
157
|
-
|
|
158
130
|
}
|
|
159
131
|
|
|
160
132
|
private fun handlePaywallCallback(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
campaignType: String?,
|
|
164
|
-
campaignLabel: String?,
|
|
165
|
-
campaignUrl: String?,
|
|
166
|
-
paywallId: String,
|
|
167
|
-
paywallName: String?,
|
|
168
|
-
segmentId: String?,
|
|
169
|
-
externalSegmentId: String?,
|
|
170
|
-
action: NamiPaywallAction,
|
|
171
|
-
sku: NamiSKU?,
|
|
172
|
-
purchaseError: String?,
|
|
173
|
-
purchases: List<NamiPurchase>?,
|
|
174
|
-
deeplinkUrl: String?,
|
|
175
|
-
actionCallback: Callback
|
|
133
|
+
paywallEvent: NamiPaywallEvent,
|
|
134
|
+
actionCallback: Callback,
|
|
176
135
|
) {
|
|
177
|
-
val actionString = action.toString()
|
|
178
|
-
val skuString = sku?.skuId ?: ""
|
|
136
|
+
val actionString = paywallEvent.action.toString()
|
|
137
|
+
val skuString = paywallEvent.sku?.skuId ?: ""
|
|
179
138
|
|
|
180
|
-
val purchasesArray = createPurchaseArray(purchases)
|
|
139
|
+
val purchasesArray = createPurchaseArray(paywallEvent.purchases)
|
|
181
140
|
|
|
182
141
|
val resultMap = Arguments.createMap().apply {
|
|
183
|
-
putString(CAMPAIGN_ID, campaignId)
|
|
184
|
-
putString(CAMPAIGN_LABEL, campaignLabel ?: "")
|
|
185
|
-
putString(PAYWALL_ID, paywallId)
|
|
142
|
+
putString(CAMPAIGN_ID, paywallEvent.campaignId)
|
|
143
|
+
putString(CAMPAIGN_LABEL, paywallEvent.campaignLabel ?: "")
|
|
144
|
+
putString(PAYWALL_ID, paywallEvent.paywallId)
|
|
186
145
|
putString(ACTION, actionString)
|
|
187
146
|
putString(SKU_ID, skuString)
|
|
188
|
-
putString(PURCHASE_ERROR, purchaseError ?: "")
|
|
147
|
+
putString(PURCHASE_ERROR, paywallEvent.purchaseError ?: "")
|
|
189
148
|
putArray(PURCHASES, purchasesArray)
|
|
190
|
-
putString(CAMPAIGN_NAME, campaignName ?: "")
|
|
191
|
-
putString(CAMPAIGN_TYPE, campaignType ?: "")
|
|
192
|
-
putString(CAMPAIGN_URL, campaignUrl ?: "")
|
|
193
|
-
putString(PAYWALL_NAME, paywallName ?: "")
|
|
194
|
-
putString(COMPONENT_CHANGE_ID, "")
|
|
195
|
-
putString(COMPONENT_CHANGE_NAME, "")
|
|
196
|
-
putString(SEGMENT_ID, segmentId ?: "")
|
|
197
|
-
putString(EXTERNAL_SEGMENT_ID, externalSegmentId ?: "")
|
|
198
|
-
putString(DEEP_LINK_URL, deeplinkUrl ?: "")
|
|
149
|
+
putString(CAMPAIGN_NAME, paywallEvent.campaignName ?: "")
|
|
150
|
+
putString(CAMPAIGN_TYPE, paywallEvent.campaignType ?: "")
|
|
151
|
+
putString(CAMPAIGN_URL, paywallEvent.campaignUrl ?: "")
|
|
152
|
+
putString(PAYWALL_NAME, paywallEvent.paywallName ?: "")
|
|
153
|
+
putString(COMPONENT_CHANGE_ID, paywallEvent?.componentChange?.id ?: "")
|
|
154
|
+
putString(COMPONENT_CHANGE_NAME, paywallEvent?.componentChange?.name ?: "")
|
|
155
|
+
putString(SEGMENT_ID, paywallEvent.segmentId ?: "")
|
|
156
|
+
putString(EXTERNAL_SEGMENT_ID, paywallEvent.externalSegmentId ?: "")
|
|
157
|
+
putString(DEEP_LINK_URL, paywallEvent.deeplinkUrl ?: "")
|
|
199
158
|
}
|
|
200
159
|
|
|
201
160
|
emitEvent(_RESULT_CAMPAIGN, resultMap)
|
|
@@ -108,7 +108,7 @@ class NamiPaywallManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
108
108
|
if (productId != null && skuId != null && skuType != null) {
|
|
109
109
|
val namiSku = NamiSKU(
|
|
110
110
|
skuId = skuId,
|
|
111
|
-
|
|
111
|
+
productDetails = null,
|
|
112
112
|
amazonProduct = null,
|
|
113
113
|
id = productId,
|
|
114
114
|
type = skuType,
|
|
@@ -79,8 +79,7 @@ fun NamiSKU.toSkuDict(): WritableMap {
|
|
|
79
79
|
productDict.putString("skuId", this.skuId)
|
|
80
80
|
productDict.putString("id", this.id)
|
|
81
81
|
productDict.putString("type", this.type.toString())
|
|
82
|
-
productDict.putString("promoId",
|
|
83
|
-
productDict.putString("promoToken","")
|
|
82
|
+
productDict.putString("promoId", this.promoId)
|
|
84
83
|
|
|
85
84
|
return productDict
|
|
86
85
|
}
|
package/ios/Nami.m
CHANGED
|
@@ -52,7 +52,7 @@ RCT_EXPORT_METHOD(configure: (NSDictionary *)configDict completion: (RCTResponse
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
// Start commands with header iformation for Nami to let them know this is a React client.
|
|
55
|
-
NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:3.0.
|
|
55
|
+
NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:3.0.25"]];
|
|
56
56
|
|
|
57
57
|
// Add additional namiCommands app may have sent in.
|
|
58
58
|
NSObject *appCommandStrings = configDict[@"namiCommands"];
|
package/package.json
CHANGED