react-native-nami-sdk 3.0.26 → 3.0.28

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.
@@ -3,7 +3,7 @@ on:
3
3
  workflow_dispatch:
4
4
  inputs:
5
5
  ref:
6
- default: develop
6
+ default: main
7
7
  description: "Git Tag, Branch or SHA to build"
8
8
  required: true
9
9
  secrets:
@@ -14,7 +14,7 @@ on:
14
14
  types:
15
15
  - closed
16
16
  branches:
17
- - develop
17
+ - main
18
18
  secrets:
19
19
  BUILD_USER_PAT:
20
20
  required: true
@@ -3,7 +3,7 @@ on:
3
3
  workflow_dispatch:
4
4
  inputs:
5
5
  ref:
6
- default: develop
6
+ default: main
7
7
  description: "Git Tag, Branch or SHA to build"
8
8
  required: true
9
9
  secrets:
@@ -14,7 +14,7 @@ on:
14
14
  types:
15
15
  - closed
16
16
  branches:
17
- - develop
17
+ - main
18
18
  secrets:
19
19
  BUILD_USER_PAT:
20
20
  required: true
@@ -6,7 +6,7 @@ on:
6
6
  ref:
7
7
  description: "Git Tag, Branch or SHA to build"
8
8
  required: true
9
- default: "develop"
9
+ default: "main"
10
10
  earlyaccess:
11
11
  description: "Is this a early access build?"
12
12
  default: true
@@ -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.1.0"
87
+ implementation "com.namiml:sdk-android:3.1.2"
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.26")
118
+ val settingsList = mutableListOf("extendedClientInfo:react-native:3.0.28")
119
119
  namiCommandsReact?.toArrayList()?.filterIsInstance<String>()?.let { commandsFromReact ->
120
120
  settingsList.addAll(commandsFromReact)
121
121
  }
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.26"]];
55
+ NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:3.0.28"]];
56
56
 
57
57
  // Add additional namiCommands app may have sent in.
58
58
  NSObject *appCommandStrings = configDict[@"namiCommands"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nami-sdk",
3
- "version": "3.0.26",
3
+ "version": "3.0.28",
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",
@@ -20,7 +20,7 @@ Pod::Spec.new do |s|
20
20
  s.source_files = "ios/**/*.{h,m,swift}"
21
21
  s.requires_arc = true
22
22
 
23
- s.dependency 'Nami', '3.1.2'
23
+ s.dependency 'Nami', '3.1.3'
24
24
  s.dependency 'React'
25
25
 
26
26
  end
package/src/Nami.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export const Nami: {
2
2
  configure: (
3
3
  config: NamiConfiguration,
4
- resultCallback?: (resultObject: {success: boolean}) => void,
4
+ resultCallback?: (resultObject: { success: boolean }) => void,
5
5
  ) => void;
6
6
  };
7
7
 
@@ -1,8 +1,5 @@
1
- import { EmitterSubscription } from "react-native";
2
- import { NamiPurchase } from "./NamiPurchaseManager";
3
- import { NamiPaywallAction } from "./NamiPaywallManager";
4
- import { NamiSKU } from "./types";
5
- import { NamiPaywallAction, NamiPurchase } from "./types";
1
+ import { EmitterSubscription } from 'react-native';
2
+ import { NamiPaywallAction, NamiPurchase, NamiSKU } from './types';
6
3
 
7
4
  export const NamiCampaignManager: {
8
5
  allCampaigns: () => Promise<Array<NamiCampaign>>;
@@ -28,13 +25,13 @@ export const NamiCampaignManager: {
28
25
  componentChangeId?: string,
29
26
  componentChangeName?: string,
30
27
  purchaseError?: string,
31
- purchases?: NamiPurchase[]
32
- ) => void
28
+ purchases?: NamiPurchase[],
29
+ ) => void,
33
30
  ) => void;
34
31
  refresh: () => void;
35
32
  registerAvailableCampaignsHandler: (
36
- callback: (availableCampaigns: NamiCampaign[]) => void
37
- ) => EmitterSubscription["remove"];
33
+ callback: (availableCampaigns: NamiCampaign[]) => void,
34
+ ) => EmitterSubscription['remove'];
38
35
  };
39
36
 
40
37
  export type NamiCampaign = {
@@ -47,10 +44,10 @@ export type NamiCampaign = {
47
44
  };
48
45
 
49
46
  export enum NamiCampaignRule {
50
- DEFAULT = "default",
51
- LABEL = "label",
52
- UNKNOWN = "unknown",
53
- URL = "url",
47
+ DEFAULT = 'default',
48
+ LABEL = 'label',
49
+ UNKNOWN = 'unknown',
50
+ URL = 'url',
54
51
  }
55
52
 
56
53
  export enum LaunchCampaignError {
@@ -62,8 +59,8 @@ export enum LaunchCampaignError {
62
59
  }
63
60
 
64
61
  export enum LaunchCampaignResultAction {
65
- FAILURE = "FAILURE",
66
- SUCCESS = "SUCCESS",
62
+ FAILURE = 'FAILURE',
63
+ SUCCESS = 'SUCCESS',
67
64
  }
68
65
 
69
66
  export type FailureResultObject = {
@@ -27,11 +27,7 @@ export interface INamiEntitlementManager {
27
27
  export const NamiEntitlementManager: INamiEntitlementManager = {
28
28
  ...RNNamiEntitlementManager,
29
29
  emitter: new NativeEventEmitter(RNNamiEntitlementManager),
30
- refresh: (
31
- resultCallback?: (
32
- entitlements?: INamiEntitlementManager['NamiEntitlement'][],
33
- ) => void,
34
- ) => {
30
+ refresh: (resultCallback?: (entitlements?: NamiEntitlement[]) => void) => {
35
31
  if (Platform.OS === 'android') {
36
32
  RNNamiEntitlementManager.refresh(resultCallback ?? (() => {}));
37
33
  } else {
@@ -39,9 +35,7 @@ export const NamiEntitlementManager: INamiEntitlementManager = {
39
35
  }
40
36
  },
41
37
  registerActiveEntitlementsHandler: (
42
- callback: (
43
- activeEntitlements: INamiEntitlementManager['NamiEntitlement'][],
44
- ) => void,
38
+ callback: (activeEntitlements: NamiEntitlement[]) => void,
45
39
  ) => {
46
40
  let subscription: EmitterSubscription =
47
41
  NamiEntitlementManager.emitter.addListener(
@@ -1,19 +1,23 @@
1
- import { EmitterSubscription } from "react-native";
2
- import { NamiSKU } from "./types";
1
+ import { EmitterSubscription } from 'react-native';
2
+ import { NamiSKU } from './types';
3
3
 
4
4
  export const NamiPaywallManager: {
5
5
  buySkuCompleteApple: (purchaseSuccess: NamiPurchaseSuccessApple) => void;
6
6
  buySkuCompleteAmazon: (purchaseSuccess: NamiPurchaseSuccessAmazon) => void;
7
7
  buySkuCompleteGooglePlay: (
8
- purchaseSuccess: NamiPurchaseSuccessGooglePlay
8
+ purchaseSuccess: NamiPurchaseSuccessGooglePlay,
9
9
  ) => void;
10
10
  dismiss: (animated?: boolean) => void;
11
11
  registerBuySkuHandler: (
12
- callback: (sku: NamiSKU) => void
13
- ) => EmitterSubscription["remove"];
14
- registerCloseHandler: (callback: () => void) => EmitterSubscription["remove"];
15
- registerSignInHandler: (callback: () => void) => EmitterSubscription["remove"];
16
- registerRestoreHandler: (callback: () => void) => EmitterSubscription["remove"];
12
+ callback: (sku: NamiSKU) => void,
13
+ ) => EmitterSubscription['remove'];
14
+ registerCloseHandler: (callback: () => void) => EmitterSubscription['remove'];
15
+ registerSignInHandler: (
16
+ callback: () => void,
17
+ ) => EmitterSubscription['remove'];
18
+ registerRestoreHandler: (
19
+ callback: () => void,
20
+ ) => EmitterSubscription['remove'];
17
21
  show: () => void;
18
22
  hide: () => void;
19
23
  isHidden: () => Promise<boolean>;
@@ -37,14 +41,14 @@ export type NamiPurchaseSuccessGooglePlay = {
37
41
  purchaseDate: number;
38
42
  expiresDate?: number;
39
43
  purchaseToken: string;
40
- purchaseSource: "CAMPAIGN" | "MARKETPLACE" | "UNKNOWN";
44
+ purchaseSource: 'CAMPAIGN' | 'MARKETPLACE' | 'UNKNOWN';
41
45
  };
42
46
 
43
47
  export type NamiPurchaseSuccessAmazon = {
44
48
  product: NamiSKU;
45
49
  purchaseDate: number;
46
50
  expiresDate?: number;
47
- purchaseSource: "CAMPAIGN" | "MARKETPLACE" | "UNKNOWN";
51
+ purchaseSource: 'CAMPAIGN' | 'MARKETPLACE' | 'UNKNOWN';
48
52
  receiptId: string;
49
53
  localizedPrice: string;
50
54
  userId: string;
@@ -52,22 +56,22 @@ export type NamiPurchaseSuccessAmazon = {
52
56
  };
53
57
 
54
58
  export enum NamiPaywallAction {
55
- BUY_SKU = "BUY_SKU",
56
- SELECT_SKU = "SELECT_SKU",
57
- RESTORE_PURCHASES = "RESTORE_PURCHASES",
58
- SIGN_IN = "SIGN_IN",
59
- CLOSE_PAYWALL = "CLOSE_PAYWALL",
60
- SHOW_PAYWALL = "SHOW_PAYWALL",
61
- PURCHASE_SELECTED_SKU = "PURCHASE_SELECTED_SKU",
62
- PURCHASE_SUCCESS = "PURCHASE_SUCCESS",
63
- PURCHASE_FAILED = "PURCHASE_FAILED",
64
- PURCHASE_CANCELLED = "PURCHASE_CANCELLED",
65
- PURCHASE_PENDING = "PURCHASE_PENDING",
66
- PURCHASE_UNKNOWN = "PURCHASE_UNKNOWN",
67
- PURCHASE_DEFERRED = "PURCHASE_DEFERRED",
68
- DEEPLINK = "DEEPLINK",
69
- TOGGLE_CHANGE = "TOGGLE_CHANGE",
70
- PAGE_CHANGE = "PAGE_CHANGE",
71
- SLIDE_CHANGE = "SLIDE_CHANGE",
72
- UNKNOWN = "UNKNOWN"
59
+ BUY_SKU = 'BUY_SKU',
60
+ SELECT_SKU = 'SELECT_SKU',
61
+ RESTORE_PURCHASES = 'RESTORE_PURCHASES',
62
+ SIGN_IN = 'SIGN_IN',
63
+ CLOSE_PAYWALL = 'CLOSE_PAYWALL',
64
+ SHOW_PAYWALL = 'SHOW_PAYWALL',
65
+ PURCHASE_SELECTED_SKU = 'PURCHASE_SELECTED_SKU',
66
+ PURCHASE_SUCCESS = 'PURCHASE_SUCCESS',
67
+ PURCHASE_FAILED = 'PURCHASE_FAILED',
68
+ PURCHASE_CANCELLED = 'PURCHASE_CANCELLED',
69
+ PURCHASE_PENDING = 'PURCHASE_PENDING',
70
+ PURCHASE_UNKNOWN = 'PURCHASE_UNKNOWN',
71
+ PURCHASE_DEFERRED = 'PURCHASE_DEFERRED',
72
+ DEEPLINK = 'DEEPLINK',
73
+ TOGGLE_CHANGE = 'TOGGLE_CHANGE',
74
+ PAGE_CHANGE = 'PAGE_CHANGE',
75
+ SLIDE_CHANGE = 'SLIDE_CHANGE',
76
+ UNKNOWN = 'UNKNOWN',
73
77
  }
@@ -42,7 +42,7 @@ export interface INamiPaywallManager {
42
42
  dismiss: (animated?: boolean) => void;
43
43
  show: () => void;
44
44
  hide: () => void;
45
- isHidden: () => Promise<void>;
45
+ isHidden: () => Promise<boolean>;
46
46
  }
47
47
 
48
48
  const { NamiPaywallManagerBridge, RNNamiPaywallManager } = NativeModules;
@@ -99,8 +99,8 @@ export const NamiPaywallManager: INamiPaywallManager = {
99
99
  let subscription;
100
100
  subscription = NamiPaywallManager.paywallEmitter.addListener(
101
101
  NamiPaywallManagerEvents.PaywallSignInRequested,
102
- body => {
103
- callback(body);
102
+ () => {
103
+ callback();
104
104
  },
105
105
  );
106
106
  RNNamiPaywallManager.registerSignInHandler();
@@ -115,8 +115,8 @@ export const NamiPaywallManager: INamiPaywallManager = {
115
115
  let subscription;
116
116
  subscription = NamiPaywallManager.paywallEmitter.addListener(
117
117
  NamiPaywallManagerEvents.PaywallRestoreRequested,
118
- body => {
119
- callback(body);
118
+ () => {
119
+ callback();
120
120
  },
121
121
  );
122
122
  RNNamiPaywallManager.registerRestoreHandler();
package/src/types.ts CHANGED
@@ -164,6 +164,7 @@ export enum NamiCampaignRuleType {
164
164
  DEFAULT = 'default',
165
165
  LABEL = 'label',
166
166
  UNKNOWN = 'unknown',
167
+ URL = 'url',
167
168
  }
168
169
 
169
170
  export enum LaunchCampaignError {