react-native-nami-sdk 3.2.3 → 3.2.5
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/.eslintignore +1 -1
- package/.github/workflows/CI.yaml +1 -1
- package/.github/workflows/app_prod.yaml +0 -5
- package/.github/workflows/app_stg.yaml +1 -1
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +1 -1
- package/android/src/main/java/com/nami/reactlibrary/NamiCampaignManagerBridge.kt +8 -2
- package/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +1 -1
- package/index.ts +0 -1
- package/ios/Nami.m +1 -1
- package/ios/NamiCampaignManagerBridge.m +1 -1
- package/ios/NamiCampaignManagerBridge.swift +8 -5
- package/package.json +1 -1
- package/react-native-nami-sdk.podspec +1 -1
- package/src/NamiCampaignManager.d.ts +1 -1
- package/src/NamiCampaignManager.ts +1 -1
- package/src/types.d.ts +9 -1
- package/src/types.ts +10 -1
package/.eslintignore
CHANGED
|
@@ -323,7 +323,7 @@ jobs:
|
|
|
323
323
|
arch: x86
|
|
324
324
|
channel: canary
|
|
325
325
|
profile: pixel
|
|
326
|
-
avd-name:
|
|
326
|
+
avd-name: Pixel_4_API_34
|
|
327
327
|
script: yarn detox test --configuration ${{ env.DETOX_CONFIGURATION }} e2e/android --headless --record-logs all
|
|
328
328
|
working-directory: source/examples/Basic
|
|
329
329
|
|
|
@@ -208,11 +208,6 @@ jobs:
|
|
|
208
208
|
pod install --repo-update
|
|
209
209
|
working-directory: source/examples/Basic/ios
|
|
210
210
|
|
|
211
|
-
- name: Apply Patches
|
|
212
|
-
run: |
|
|
213
|
-
patch -p0 < *.patch
|
|
214
|
-
working-directory: source/examples/Basic/patches
|
|
215
|
-
|
|
216
211
|
- name: Build resolve Swift dependencies
|
|
217
212
|
run: |
|
|
218
213
|
xcodebuild -resolvePackageDependencies -workspace ios/Basic.xcworkspace -scheme BasicProduction -configuration Release
|
package/android/build.gradle
CHANGED
|
@@ -37,7 +37,7 @@ android {
|
|
|
37
37
|
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
|
38
38
|
defaultConfig {
|
|
39
39
|
minSdkVersion 22
|
|
40
|
-
targetSdkVersion
|
|
40
|
+
targetSdkVersion 34
|
|
41
41
|
versionCode 1
|
|
42
42
|
versionName "1.0"
|
|
43
43
|
}
|
|
@@ -85,8 +85,8 @@ dependencies {
|
|
|
85
85
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
86
86
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
87
87
|
|
|
88
|
-
playImplementation "com.namiml:sdk-android:3.2.
|
|
89
|
-
amazonImplementation "com.namiml:sdk-amazon:3.2.
|
|
88
|
+
playImplementation "com.namiml:sdk-android:3.2.5"
|
|
89
|
+
amazonImplementation "com.namiml:sdk-amazon:3.2.5"
|
|
90
90
|
|
|
91
91
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
92
92
|
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
|
|
@@ -106,7 +106,7 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
106
106
|
} else {
|
|
107
107
|
Arguments.createArray()
|
|
108
108
|
}
|
|
109
|
-
val settingsList = mutableListOf("extendedClientInfo:react-native:3.2.
|
|
109
|
+
val settingsList = mutableListOf("extendedClientInfo:react-native:3.2.5")
|
|
110
110
|
namiCommandsReact?.toArrayList()?.filterIsInstance<String>()?.let { commandsFromReact ->
|
|
111
111
|
settingsList.addAll(commandsFromReact)
|
|
112
112
|
}
|
|
@@ -294,8 +294,14 @@ class NamiCampaignManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
@ReactMethod
|
|
297
|
-
|
|
298
|
-
NamiCampaignManager.refresh {
|
|
297
|
+
fun refresh(promise: Promise) {
|
|
298
|
+
NamiCampaignManager.refresh { campaigns ->
|
|
299
|
+
val array = WritableNativeArray()
|
|
300
|
+
campaigns?.forEach { campaign ->
|
|
301
|
+
array.pushMap(campaignToReadableMap(campaign))
|
|
302
|
+
}
|
|
303
|
+
promise.resolve(array)
|
|
304
|
+
}
|
|
299
305
|
}
|
|
300
306
|
|
|
301
307
|
@ReactMethod
|
|
@@ -222,7 +222,7 @@ class NamiPaywallManagerBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
222
222
|
|
|
223
223
|
@ReactMethod
|
|
224
224
|
fun setProductDetails(productDetails: String, allowOffers: Boolean) {
|
|
225
|
-
NamiPaywallManager.setProductDetails(productDetails, allowOffers =
|
|
225
|
+
NamiPaywallManager.setProductDetails(productDetails, allowOffers = allowOffers)
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
@ReactMethod
|
package/index.ts
CHANGED
|
@@ -6,5 +6,4 @@ export { NamiEntitlementManager } from './src/NamiEntitlementManager';
|
|
|
6
6
|
export { NamiManager } from './src/NamiManager';
|
|
7
7
|
export { NamiPurchaseManager } from './src/NamiPurchaseManager';
|
|
8
8
|
export { NamiPaywallManager } from './src/NamiPaywallManager';
|
|
9
|
-
export { NamiSKU } from './src/types';
|
|
10
9
|
export * from './src/types';
|
package/ios/Nami.m
CHANGED
|
@@ -50,7 +50,7 @@ RCT_EXPORT_METHOD(configure: (NSDictionary *)configDict completion: (RCTResponse
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// Start commands with header iformation for Nami to let them know this is a React client.
|
|
53
|
-
NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:3.2.
|
|
53
|
+
NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:3.2.5"]];
|
|
54
54
|
|
|
55
55
|
// Add additional namiCommands app may have sent in.
|
|
56
56
|
NSObject *appCommandStrings = configDict[@"namiCommands"];
|
|
@@ -15,7 +15,7 @@ RCT_EXTERN_METHOD(allCampaigns:(RCTPromiseResolveBlock)resolve rejecter:(RCTProm
|
|
|
15
15
|
|
|
16
16
|
RCT_EXTERN_METHOD(isCampaignAvailable:(nullable NSString *)campaignSource resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
17
17
|
|
|
18
|
-
RCT_EXTERN_METHOD(refresh)
|
|
18
|
+
RCT_EXTERN_METHOD(refresh:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
19
19
|
|
|
20
20
|
RCT_EXTERN_METHOD(registerAvailableCampaignsHandler)
|
|
21
21
|
|
|
@@ -82,9 +82,9 @@ class RNNamiCampaignManager: RCTEventEmitter {
|
|
|
82
82
|
case .slide_change:
|
|
83
83
|
actionString = "SLIDE_CHANGE"
|
|
84
84
|
case .nami_collapsible_drawer_open:
|
|
85
|
-
|
|
85
|
+
actionString = "COLLAPSIBLE_DRAWER_OPEN"
|
|
86
86
|
case .nami_collapsible_drawer_close:
|
|
87
|
-
|
|
87
|
+
actionString = "COLLAPSIBLE_DRAWER_CLOSE"
|
|
88
88
|
case .video_play:
|
|
89
89
|
actionString = "VIDEO_STARTED"
|
|
90
90
|
case .video_pause:
|
|
@@ -270,9 +270,12 @@ class RNNamiCampaignManager: RCTEventEmitter {
|
|
|
270
270
|
resolve(isCampaignAvailable)
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
@objc(refresh)
|
|
274
|
-
func refresh() {
|
|
275
|
-
NamiCampaignManager.refresh
|
|
273
|
+
@objc(refresh:rejecter:)
|
|
274
|
+
func refresh(resolve: @escaping RCTPromiseResolveBlock, reject _: @escaping RCTPromiseRejectBlock) {
|
|
275
|
+
NamiCampaignManager.refresh { campaigns in
|
|
276
|
+
let dictionaries = campaigns.map { campaign in self.campaignInToDictionary(campaign) }
|
|
277
|
+
resolve(dictionaries)
|
|
278
|
+
}
|
|
276
279
|
}
|
|
277
280
|
|
|
278
281
|
@objc(registerAvailableCampaignsHandler)
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ interface ICampaignManager {
|
|
|
11
11
|
allCampaigns: () => Promise<Array<NamiCampaign>>;
|
|
12
12
|
isCampaignAvailable(campaignSource: string | null): Promise<boolean>;
|
|
13
13
|
launch: (label?: string, withUrl?: string, context?: PaywallLaunchContext, resultCallback?: (success: boolean, error?: LaunchCampaignError) => void, actionCallback?: NamiPaywallActionHandler) => void;
|
|
14
|
-
refresh: () =>
|
|
14
|
+
refresh: () => Promise<Array<NamiCampaign>>;
|
|
15
15
|
registerAvailableCampaignsHandler: (callback: (availableCampaigns: NamiCampaign[]) => void) => EmitterSubscription['remove'];
|
|
16
16
|
}
|
|
17
17
|
export declare const NamiCampaignManager: ICampaignManager;
|
|
@@ -32,7 +32,7 @@ interface ICampaignManager {
|
|
|
32
32
|
resultCallback?: (success: boolean, error?: LaunchCampaignError) => void,
|
|
33
33
|
actionCallback?: NamiPaywallActionHandler,
|
|
34
34
|
) => void;
|
|
35
|
-
refresh: () =>
|
|
35
|
+
refresh: () => Promise<Array<NamiCampaign>>;
|
|
36
36
|
registerAvailableCampaignsHandler: (
|
|
37
37
|
callback: (availableCampaigns: NamiCampaign[]) => void,
|
|
38
38
|
) => EmitterSubscription['remove'];
|
package/src/types.d.ts
CHANGED
|
@@ -47,13 +47,20 @@ export type AppleProduct = {
|
|
|
47
47
|
export type GoogleProduct = {};
|
|
48
48
|
export type AmazonProduct = {};
|
|
49
49
|
export type NamiCampaign = {
|
|
50
|
-
|
|
50
|
+
name: string;
|
|
51
51
|
rule: string;
|
|
52
52
|
segment: string;
|
|
53
53
|
paywall: string;
|
|
54
54
|
type: NamiCampaignRuleType;
|
|
55
55
|
value?: string | null;
|
|
56
|
+
form_factors: NamiFormFactor[];
|
|
57
|
+
external_segment: string | null;
|
|
56
58
|
};
|
|
59
|
+
type NamiFormFactor = {
|
|
60
|
+
form_factor: string;
|
|
61
|
+
supports_portrait?: boolean;
|
|
62
|
+
supports_landscape?: boolean;
|
|
63
|
+
}
|
|
57
64
|
export declare enum NamiCampaignRuleType {
|
|
58
65
|
DEFAULT = "default",
|
|
59
66
|
LABEL = "label",
|
|
@@ -158,6 +165,7 @@ export type NamiPurchase = {
|
|
|
158
165
|
sku?: NamiSKU;
|
|
159
166
|
skuId: string;
|
|
160
167
|
transactionIdentifier?: string;
|
|
168
|
+
purchaseToken?: string;
|
|
161
169
|
expires?: Date;
|
|
162
170
|
purchaseInitiatedTimestamp: Date;
|
|
163
171
|
purchaseSource?: 'CAMPAIGN' | 'MARKETPLACE' | 'UNKNOWN';
|
package/src/types.ts
CHANGED
|
@@ -153,12 +153,14 @@ export type AmazonProduct = {};
|
|
|
153
153
|
|
|
154
154
|
// NamiCampaignManager
|
|
155
155
|
export type NamiCampaign = {
|
|
156
|
-
|
|
156
|
+
name: string;
|
|
157
157
|
rule: string;
|
|
158
158
|
segment: string;
|
|
159
159
|
paywall: string;
|
|
160
160
|
type: NamiCampaignRuleType;
|
|
161
161
|
value?: string | null;
|
|
162
|
+
form_factors: NamiFormFactor[];
|
|
163
|
+
external_segment: string | null;
|
|
162
164
|
};
|
|
163
165
|
|
|
164
166
|
export enum NamiCampaignRuleType {
|
|
@@ -168,6 +170,12 @@ export enum NamiCampaignRuleType {
|
|
|
168
170
|
URL = 'url',
|
|
169
171
|
}
|
|
170
172
|
|
|
173
|
+
type NamiFormFactor = {
|
|
174
|
+
form_factor?: string;
|
|
175
|
+
supports_portrait?: boolean;
|
|
176
|
+
supports_landscape?: boolean;
|
|
177
|
+
};
|
|
178
|
+
|
|
171
179
|
export enum LaunchCampaignError {
|
|
172
180
|
DEFAULT_CAMPAIGN_NOT_FOUND = 0,
|
|
173
181
|
LABELED_CAMPAIGN_NOT_FOUND = 1,
|
|
@@ -295,6 +303,7 @@ export type NamiPurchase = {
|
|
|
295
303
|
sku?: NamiSKU;
|
|
296
304
|
skuId: string;
|
|
297
305
|
transactionIdentifier?: string;
|
|
306
|
+
purchaseToken?: string;
|
|
298
307
|
expires?: Date;
|
|
299
308
|
purchaseInitiatedTimestamp: Date;
|
|
300
309
|
purchaseSource?: 'CAMPAIGN' | 'MARKETPLACE' | 'UNKNOWN';
|