react-native-nami-sdk 3.3.3-6 → 3.3.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.
@@ -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.3.3.5"
89
- amazonImplementation "com.namiml:sdk-amazon:3.3.3.5"
88
+ playImplementation "com.namiml:sdk-android:3.3.4"
89
+ amazonImplementation "com.namiml:sdk-amazon:3.3.4"
90
90
 
91
91
  implementation "com.facebook.react:react-native:+" // From node_modules
92
92
  coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4"
@@ -347,6 +347,28 @@ class NamiCampaignManagerBridgeModule internal constructor(
347
347
  promise.resolve(isCampaignAvailable)
348
348
  }
349
349
 
350
+ @ReactMethod
351
+ fun isFlow(
352
+ label: String?,
353
+ withUrl: String?,
354
+ promise: Promise,
355
+ ) {
356
+ try {
357
+ val uri = if (!withUrl.isNullOrEmpty()) {
358
+ val parsedUri = Uri.parse(withUrl)
359
+ if (parsedUri.scheme.isNullOrEmpty()) {
360
+ promise.reject("ISFLOW_ERROR", "Invalid URL format: missing scheme", null)
361
+ return
362
+ }
363
+ parsedUri
364
+ } else null
365
+ val result = NamiCampaignManager.isFlow(label = label, uri = uri)
366
+ promise.resolve(result)
367
+ } catch (e: Exception) {
368
+ promise.reject("ISFLOW_ERROR", "Failed to check if campaign is flow: ${e.message}", e)
369
+ }
370
+ }
371
+
350
372
  @ReactMethod
351
373
  fun refresh(promise: Promise) {
352
374
  NamiCampaignManager.refresh { campaigns ->
@@ -52,7 +52,11 @@ class NamiFlowManagerBridgeModule internal constructor(
52
52
  @ReactMethod
53
53
  fun resume() {
54
54
  Handler(Looper.getMainLooper()).postDelayed({
55
- NamiFlowManager.resume()
55
+ if (reactApplicationContext.hasCurrentActivity()) {
56
+ NamiFlowManager.resume(reactApplicationContext.currentActivity)
57
+ } else {
58
+ NamiFlowManager.resume()
59
+ }
56
60
  }, 100L)
57
61
  }
58
62
 
@@ -71,6 +71,7 @@ export interface Spec extends TurboModule {
71
71
  value?: string;
72
72
  }[]>;
73
73
  isCampaignAvailable(source?: string): Promise<boolean>;
74
+ isFlow(label?: string | null, withUrl?: string | null): Promise<boolean>;
74
75
  refresh(): Promise<{
75
76
  id?: string;
76
77
  rule?: string;
@@ -17,6 +17,7 @@ export declare const NamiCampaignManager: {
17
17
  value?: string;
18
18
  }[]>;
19
19
  isCampaignAvailable: (campaignName: string | null) => Promise<boolean>;
20
+ isFlow: (label?: string | null, withUrl?: string | null) => Promise<boolean>;
20
21
  refresh: () => Promise<{
21
22
  id?: string;
22
23
  rule?: string;
@@ -2,4 +2,4 @@
2
2
  * Auto-generated file. Do not edit manually.
3
3
  * React Native Nami SDK version.
4
4
  */
5
- export declare const NAMI_REACT_NATIVE_VERSION = "3.3.3-6";
5
+ export declare const NAMI_REACT_NATIVE_VERSION = "3.3.4";
@@ -16,6 +16,8 @@ RCT_EXTERN_METHOD(allCampaigns:(RCTPromiseResolveBlock)resolve rejecter:(RCTProm
16
16
 
17
17
  RCT_EXTERN_METHOD(isCampaignAvailable:(nullable NSString *)campaignSource resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
18
18
 
19
+ RCT_EXTERN_METHOD(isFlow:(nullable NSString *)label withUrl:(nullable NSString *)withUrl resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
20
+
19
21
  RCT_EXTERN_METHOD(refresh:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
20
22
 
21
23
  RCT_EXTERN_METHOD(registerAvailableCampaignsHandler)
@@ -289,6 +289,22 @@ class RNNamiCampaignManager: RCTEventEmitter {
289
289
  resolve(isCampaignAvailable)
290
290
  }
291
291
 
292
+ @objc(isFlow:withUrl:resolver:rejecter:)
293
+ func isFlow(
294
+ label: String?,
295
+ withUrl: String?,
296
+ resolve: @escaping RCTPromiseResolveBlock,
297
+ reject _: @escaping RCTPromiseRejectBlock
298
+ ) {
299
+ var url: URL?
300
+ if let withUrl = withUrl {
301
+ url = URL(string: withUrl)
302
+ }
303
+
304
+ let result = NamiCampaignManager.isFlow(label: label, url: url)
305
+ resolve(result)
306
+ }
307
+
292
308
  @objc(refresh:rejecter:)
293
309
  func refresh(resolve: @escaping RCTPromiseResolveBlock, reject _: @escaping RCTPromiseRejectBlock) {
294
310
  NamiCampaignManager.refresh { campaigns in
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-nami-sdk",
3
- "version": "3.3.3-6",
4
- "description": "React Native SDK for Nami - No-code paywall management with A/B testing.",
3
+ "version": "3.3.4",
4
+ "description": "React Native SDK for Nami - No-code paywall and onboarding flows with A/B testing.",
5
5
  "main": "index.ts",
6
6
  "types": "dist/index.d.ts",
7
7
  "codegenConfig": {
@@ -35,7 +35,6 @@
35
35
  "keywords": [
36
36
  "in-app-purchase",
37
37
  "ios",
38
- "ipados",
39
38
  "tvos",
40
39
  "paywall",
41
40
  "react-native",
@@ -43,7 +42,8 @@
43
42
  "subscriptions",
44
43
  "iap",
45
44
  "play-billing",
46
- "payments"
45
+ "payments",
46
+ "onboarding"
47
47
  ],
48
48
  "author": {
49
49
  "username": "hellonami",
@@ -52,12 +52,8 @@
52
52
  },
53
53
  "contributors": [
54
54
  {
55
- "name": "Francisco Pena",
56
- "email": "francisco.pena@namiml.com"
57
- },
58
- {
59
- "name": "Kendall Gelner",
60
- "email": "kendall.gelner@namiml.com"
55
+ "name": "Dan Burcaw",
56
+ "email": "dan.burcaw@namiml.com"
61
57
  }
62
58
  ],
63
59
  "license": "SEE LICENSE FILE",
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
21
21
  s.requires_arc = true
22
22
  s.swift_version = '5.0' # or your supported version
23
23
 
24
- s.dependency 'Nami', '3.3.3.5'
24
+ s.dependency 'Nami', '3.3.4.1'
25
25
  s.dependency 'React'
26
26
 
27
27
  pod_target_xcconfig = {
@@ -78,6 +78,8 @@ export interface Spec extends TurboModule {
78
78
 
79
79
  isCampaignAvailable(source?: string): Promise<boolean>;
80
80
 
81
+ isFlow(label?: string | null, withUrl?: string | null): Promise<boolean>;
82
+
81
83
  refresh(): Promise<
82
84
  {
83
85
  id?: string;
@@ -97,6 +97,10 @@ export const NamiCampaignManager = {
97
97
  );
98
98
  },
99
99
 
100
+ isFlow: async (label?: string | null, withUrl?: string | null) => {
101
+ return await RNNamiCampaignManager.isFlow(label, withUrl);
102
+ },
103
+
100
104
  refresh: async () => {
101
105
  return await RNNamiCampaignManager.refresh();
102
106
  },
package/src/version.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Auto-generated file. Do not edit manually.
3
3
  * React Native Nami SDK version.
4
4
  */
5
- export const NAMI_REACT_NATIVE_VERSION = '3.3.3-6';
5
+ export const NAMI_REACT_NATIVE_VERSION = '3.3.4';