react-native-nami-sdk 3.4.2-dev.202605300214 → 3.4.2-dev.202606022148
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 +2 -2
- package/dist/specs/NativeNamiPurchaseManager.d.ts +1 -0
- package/dist/src/types.d.ts +2 -0
- package/dist/src/version.d.ts +1 -1
- package/ios/NamiPurchaseManagerBridge.swift +1 -0
- package/package.json +2 -2
- package/react-native-nami-sdk.podspec +1 -1
- package/specs/NativeNamiPurchaseManager.ts +1 -0
- package/src/__tests__/transformers.test.ts +24 -3
- package/src/types.ts +2 -0
- package/src/version.ts +1 -1
package/android/build.gradle
CHANGED
|
@@ -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.4.2-dev.
|
|
89
|
-
amazonImplementation "com.namiml:sdk-amazon:3.4.2-dev.
|
|
88
|
+
playImplementation "com.namiml:sdk-android:3.4.2-dev.202606022148"
|
|
89
|
+
amazonImplementation "com.namiml:sdk-amazon:3.4.2-dev.202606022148"
|
|
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"
|
package/dist/src/types.d.ts
CHANGED
|
@@ -193,6 +193,7 @@ export type NamiPurchase = {
|
|
|
193
193
|
sku?: NamiSKU;
|
|
194
194
|
skuId: string;
|
|
195
195
|
transactionIdentifier?: string;
|
|
196
|
+
originalTransactionIdentifier?: string;
|
|
196
197
|
purchaseToken?: string;
|
|
197
198
|
expires?: Date;
|
|
198
199
|
purchaseInitiatedTimestamp: Date;
|
|
@@ -202,6 +203,7 @@ export type NamiPurchaseFromBridge = {
|
|
|
202
203
|
sku?: NamiSKU;
|
|
203
204
|
skuId: string;
|
|
204
205
|
transactionIdentifier?: string;
|
|
206
|
+
originalTransactionIdentifier?: string;
|
|
205
207
|
purchaseToken?: string;
|
|
206
208
|
expires?: number;
|
|
207
209
|
purchaseInitiatedTimestamp: number;
|
package/dist/src/version.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ class RNNamiPurchaseManager: RCTEventEmitter {
|
|
|
94
94
|
var purchaseDict: [String: Any?] = [
|
|
95
95
|
"skuId": purchase.skuId,
|
|
96
96
|
"transactionIdentifier": purchase.transactionIdentifier,
|
|
97
|
+
"originalTransactionIdentifier": purchase.originalTransactionId,
|
|
97
98
|
"sku": skuDictionary,
|
|
98
99
|
"purchaseInitiatedTimestamp": purchase.purchaseInitiatedTimestamp.timeIntervalSince1970 * 1000,
|
|
99
100
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nami-sdk",
|
|
3
|
-
"version": "3.4.2-dev.
|
|
3
|
+
"version": "3.4.2-dev.202606022148",
|
|
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",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@namiml/expo-nami-iap": "3.4.2-dev.
|
|
66
|
+
"@namiml/expo-nami-iap": "3.4.2-dev.202606022148",
|
|
67
67
|
"react": ">=18",
|
|
68
68
|
"react-native": ">=0.73"
|
|
69
69
|
},
|
|
@@ -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.4.2-dev.
|
|
24
|
+
s.dependency 'Nami', '3.4.2-dev.202606022148'
|
|
25
25
|
|
|
26
26
|
pod_target_xcconfig = {
|
|
27
27
|
'DEFINES_MODULE' => 'YES',
|
|
@@ -14,6 +14,7 @@ export interface Spec extends TurboModule {
|
|
|
14
14
|
promoToken?: string;
|
|
15
15
|
};
|
|
16
16
|
transactionIdentifier?: string;
|
|
17
|
+
originalTransactionIdentifier?: string;
|
|
17
18
|
purchaseToken?: string;
|
|
18
19
|
expires?: number; // timestamp in milliseconds
|
|
19
20
|
purchaseInitiatedTimestamp: number; // timestamp in milliseconds
|
|
@@ -46,6 +46,7 @@ describe('parsePurchaseDates', () => {
|
|
|
46
46
|
const raw = {
|
|
47
47
|
skuId: 'com.example.monthly',
|
|
48
48
|
transactionIdentifier: 'txn_123',
|
|
49
|
+
originalTransactionIdentifier: 'orig_txn_456',
|
|
49
50
|
purchaseSource: 'CAMPAIGN' as const,
|
|
50
51
|
purchaseInitiatedTimestamp: 1700000000000,
|
|
51
52
|
sku: { id: 'sku_1', skuId: 'com.example.monthly', type: 'subscription' },
|
|
@@ -54,9 +55,21 @@ describe('parsePurchaseDates', () => {
|
|
|
54
55
|
|
|
55
56
|
expect(result.skuId).toBe('com.example.monthly');
|
|
56
57
|
expect(result.transactionIdentifier).toBe('txn_123');
|
|
58
|
+
expect(result.originalTransactionIdentifier).toBe('orig_txn_456');
|
|
57
59
|
expect(result.purchaseSource).toBe('CAMPAIGN');
|
|
58
60
|
expect(result.sku).toEqual(raw.sku);
|
|
59
61
|
});
|
|
62
|
+
|
|
63
|
+
it('leaves originalTransactionIdentifier undefined when the bridge omits it', () => {
|
|
64
|
+
const raw = {
|
|
65
|
+
skuId: 'com.example.monthly',
|
|
66
|
+
transactionIdentifier: 'txn_123',
|
|
67
|
+
purchaseInitiatedTimestamp: 1700000000000,
|
|
68
|
+
};
|
|
69
|
+
const result = parsePurchaseDates(raw);
|
|
70
|
+
|
|
71
|
+
expect(result.originalTransactionIdentifier).toBeUndefined();
|
|
72
|
+
});
|
|
60
73
|
});
|
|
61
74
|
|
|
62
75
|
describe('coerceSkuType', () => {
|
|
@@ -105,14 +118,18 @@ describe('parseEntitlements', () => {
|
|
|
105
118
|
desc: 'Premium access',
|
|
106
119
|
referenceId: 'premium',
|
|
107
120
|
activePurchases: [rawPurchase],
|
|
108
|
-
purchasedSkus: [
|
|
121
|
+
purchasedSkus: [
|
|
122
|
+
{ id: 'sku_1', skuId: 'com.example.monthly', type: 'subscription' },
|
|
123
|
+
],
|
|
109
124
|
relatedSkus: [],
|
|
110
125
|
},
|
|
111
126
|
];
|
|
112
127
|
const result = parseEntitlements(raw);
|
|
113
128
|
|
|
114
129
|
expect(result).toHaveLength(1);
|
|
115
|
-
expect(
|
|
130
|
+
expect(
|
|
131
|
+
result[0].activePurchases[0].purchaseInitiatedTimestamp,
|
|
132
|
+
).toBeInstanceOf(Date);
|
|
116
133
|
expect(result[0].activePurchases[0].expires).toBeInstanceOf(Date);
|
|
117
134
|
});
|
|
118
135
|
|
|
@@ -132,7 +149,11 @@ describe('parseEntitlements', () => {
|
|
|
132
149
|
});
|
|
133
150
|
|
|
134
151
|
it('preserves existing relatedSkus and purchasedSkus', () => {
|
|
135
|
-
const sku = {
|
|
152
|
+
const sku = {
|
|
153
|
+
id: 'sku_1',
|
|
154
|
+
skuId: 'com.example.monthly',
|
|
155
|
+
type: 'subscription',
|
|
156
|
+
};
|
|
136
157
|
const raw = [
|
|
137
158
|
{
|
|
138
159
|
name: 'Premium',
|
package/src/types.ts
CHANGED
|
@@ -331,6 +331,7 @@ export type NamiPurchase = {
|
|
|
331
331
|
sku?: NamiSKU;
|
|
332
332
|
skuId: string;
|
|
333
333
|
transactionIdentifier?: string;
|
|
334
|
+
originalTransactionIdentifier?: string;
|
|
334
335
|
purchaseToken?: string;
|
|
335
336
|
expires?: Date;
|
|
336
337
|
purchaseInitiatedTimestamp: Date;
|
|
@@ -341,6 +342,7 @@ export type NamiPurchaseFromBridge = {
|
|
|
341
342
|
sku?: NamiSKU;
|
|
342
343
|
skuId: string;
|
|
343
344
|
transactionIdentifier?: string;
|
|
345
|
+
originalTransactionIdentifier?: string;
|
|
344
346
|
purchaseToken?: string;
|
|
345
347
|
expires?: number;
|
|
346
348
|
purchaseInitiatedTimestamp: number;
|
package/src/version.ts
CHANGED