Skip to content

Commit 27a4d85

Browse files
2.0.0 [sc-152528] (#25)
* V2 Release [sc-152528] * Fix quotes lint * Fix more linting * Update example/src/App.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update the example to 2.0.0 * f --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 46bb67c commit 27a4d85

File tree

7 files changed

+233
-17
lines changed

7 files changed

+233
-17
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 20.18.0
1+
nodejs 22.14.0

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ dependencies {
9797
//noinspection GradleDynamicVersion
9898
implementation "com.facebook.react:react-native:+"
9999
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
100-
implementation "com.movableink.sdk:inked:1.6.1"
100+
implementation "com.movableink.sdk:inked:2.0.0"
101101
}
102102

103103
if (isNewArchitectureEnabled()) {

example/ios/Podfile.lock

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ PODS:
7272
- hermes-engine/Pre-built (= 0.73.5)
7373
- hermes-engine/Pre-built (0.73.5)
7474
- libevent (2.1.12)
75-
- MovableInk (1.7.3)
75+
- MovableInk (2.0.0)
7676
- OpenSSL-Universal (1.1.1100)
7777
- RCT-Folly (2022.05.16.00):
7878
- boost
@@ -945,8 +945,8 @@ PODS:
945945
- React-Mapbuffer (0.73.5):
946946
- glog
947947
- React-debug
948-
- react-native-movable-ink (1.6.2):
949-
- MovableInk (= 1.7.3)
948+
- react-native-movable-ink (2.0.0):
949+
- MovableInk (= 2.0.0)
950950
- React-Core
951951
- React-nativeconfig (0.73.5)
952952
- React-NativeModulesApple (0.73.5):
@@ -1199,8 +1199,6 @@ DEPENDENCIES:
11991199

12001200
SPEC REPOS:
12011201
https://github.com/CocoaPods/Specs.git:
1202-
- MovableInk
1203-
trunk:
12041202
- CocoaAsyncSocket
12051203
- Flipper
12061204
- Flipper-Boost-iOSX
@@ -1212,6 +1210,7 @@ SPEC REPOS:
12121210
- FlipperKit
12131211
- fmt
12141212
- libevent
1213+
- MovableInk
12151214
- OpenSSL-Universal
12161215
- SocketRocket
12171216

@@ -1336,7 +1335,7 @@ SPEC CHECKSUMS:
13361335
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
13371336
hermes-engine: 1d1835b2cc54c381909d94d1b3c8e0a2f1a94a0e
13381337
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
1339-
MovableInk: 523afbf0d08ed31ec35563ee053e9116e1129165
1338+
MovableInk: 1c6879a32b0fd2c03efa9c9460986bd2f233ef68
13401339
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
13411340
RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0
13421341
RCTRequired: 2544c0f1081a5fa12e108bb8cb40e5f4581ccd87
@@ -1359,7 +1358,7 @@ SPEC CHECKSUMS:
13591358
React-jsinspector: 32db5e364bcae8fca8cdf8891830636275add0c5
13601359
React-logger: 4136cd22748f4275b04bf82f7b6853ba93b5e0e3
13611360
React-Mapbuffer: ee9b45b26e759a099a3e024df50b25af390ee998
1362-
react-native-movable-ink: f03032938b6d8f631213e563d4ce4839d63e7c47
1361+
react-native-movable-ink: 70fe2094c4746cefa1b2c3da57ea3e0822119516
13631362
React-nativeconfig: 1166714a4f7ea57a0df5c2cb44fbc70f98d580f9
13641363
React-NativeModulesApple: d4a50e6739e201716bc90178c143d019c8e09c36
13651364
React-perflogger: 0dd9f1725d55f8264b81efadd373fe1d9cca7dc2

example/src/App.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { StyleSheet, View, Text, Linking, Button } from 'react-native';
3-
import RNMovableInk from '@movable/react-native-sdk';
3+
import RNMovableInk, { Currency } from '@movable/react-native-sdk';
44

55
export default function App() {
66
const [link, setLink] = React.useState<string | undefined>();
@@ -70,7 +70,8 @@ export default function App() {
7070
RNMovableInk.productAdded({
7171
id: '123',
7272
title: 'Test Product',
73-
price: '$10.00',
73+
price: 10.0,
74+
currency: Currency.XTS,
7475
meta: {
7576
test_key: 'test_value',
7677
test_key_two: true,
@@ -80,6 +81,24 @@ export default function App() {
8081
}}
8182
/>
8283

84+
<Button
85+
title="Test Order Completed"
86+
onPress={(_event) => {
87+
RNMovableInk.orderCompleted({
88+
id: '123',
89+
revenue: '10.00',
90+
currency: Currency.XTS,
91+
products: [
92+
{
93+
id: '123',
94+
title: 'Test Product',
95+
price: '10.00',
96+
},
97+
],
98+
});
99+
}}
100+
/>
101+
83102
<Button
84103
title="Test Custom Event"
85104
onPress={(_event) => {

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@movable/react-native-sdk",
3-
"version": "1.6.2",
3+
"version": "2.0.0",
44
"description": "MovableInk React Native SDK",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",
@@ -37,7 +37,11 @@
3737
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
3838
},
3939
"keywords": [
40-
"movableink", "movable", "moveableink", "movable ink", "moveable ink"
40+
"movableink",
41+
"movable",
42+
"moveableink",
43+
"movable ink",
44+
"moveable ink"
4145
],
4246
"repository": "https://github.com/movableink/mobile-sdk-react-native",
4347
"author": "MovableInk <dev@movableink.com> (https://github.com/movableink)",

react-native-movable-ink.podspec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ Pod::Spec.new do |s|
1616

1717
s.source_files = "ios/**/*.{h,m,mm,swift}"
1818

19-
s.dependency "MovableInk", "1.7.3"
19+
# Enable when testing local pod
20+
# s.dependency "MovableInk"
21+
22+
# Disable when testing local pod
23+
s.dependency "MovableInk", "2.0.0"
24+
2025
s.dependency "React-Core"
2126

2227
# Don't install the dependencies when we run `pod install` in the old architecture.

src/index.tsx

Lines changed: 192 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,193 @@
11
import { NativeModules } from 'react-native';
22
const { RNMovableInk } = NativeModules;
33

4+
export enum Currency {
5+
AED = 'AED',
6+
AFN = 'AFN',
7+
ALL = 'ALL',
8+
AMD = 'AMD',
9+
ANG = 'ANG',
10+
AOA = 'AOA',
11+
ARS = 'ARS',
12+
AUD = 'AUD',
13+
AWG = 'AWG',
14+
AZN = 'AZN',
15+
BAM = 'BAM',
16+
BBD = 'BBD',
17+
BDT = 'BDT',
18+
BGN = 'BGN',
19+
BHD = 'BHD',
20+
BIF = 'BIF',
21+
BMD = 'BMD',
22+
BND = 'BND',
23+
BOB = 'BOB',
24+
BOV = 'BOV',
25+
BRL = 'BRL',
26+
BSD = 'BSD',
27+
BTN = 'BTN',
28+
BWP = 'BWP',
29+
BYN = 'BYN',
30+
BYR = 'BYR',
31+
BZD = 'BZD',
32+
CAD = 'CAD',
33+
CDF = 'CDF',
34+
CHF = 'CHF',
35+
CLF = 'CLF',
36+
CLP = 'CLP',
37+
CNY = 'CNY',
38+
COP = 'COP',
39+
COU = 'COU',
40+
CRC = 'CRC',
41+
CUC = 'CUC',
42+
CUP = 'CUP',
43+
CVE = 'CVE',
44+
CZK = 'CZK',
45+
DJF = 'DJF',
46+
DKK = 'DKK',
47+
DOP = 'DOP',
48+
DZD = 'DZD',
49+
EEK = 'EEK',
50+
EGP = 'EGP',
51+
ERN = 'ERN',
52+
ETB = 'ETB',
53+
EUR = 'EUR',
54+
FJD = 'FJD',
55+
FKP = 'FKP',
56+
GBP = 'GBP',
57+
GEL = 'GEL',
58+
GHS = 'GHS',
59+
GIP = 'GIP',
60+
GMD = 'GMD',
61+
GNF = 'GNF',
62+
GTQ = 'GTQ',
63+
GYD = 'GYD',
64+
HKD = 'HKD',
65+
HNL = 'HNL',
66+
HRK = 'HRK',
67+
HTG = 'HTG',
68+
HUF = 'HUF',
69+
IDR = 'IDR',
70+
ILS = 'ILS',
71+
INR = 'INR',
72+
IQD = 'IQD',
73+
IRR = 'IRR',
74+
ISK = 'ISK',
75+
JMD = 'JMD',
76+
JOD = 'JOD',
77+
JPY = 'JPY',
78+
KES = 'KES',
79+
KGS = 'KGS',
80+
KHR = 'KHR',
81+
KMF = 'KMF',
82+
KPW = 'KPW',
83+
KRW = 'KRW',
84+
KWD = 'KWD',
85+
KYD = 'KYD',
86+
KZT = 'KZT',
87+
LAK = 'LAK',
88+
LBP = 'LBP',
89+
LKR = 'LKR',
90+
LRD = 'LRD',
91+
LSL = 'LSL',
92+
LTL = 'LTL',
93+
LVL = 'LVL',
94+
LYD = 'LYD',
95+
MAD = 'MAD',
96+
MDL = 'MDL',
97+
MGA = 'MGA',
98+
MKD = 'MKD',
99+
MMK = 'MMK',
100+
MNT = 'MNT',
101+
MOP = 'MOP',
102+
MRO = 'MRO',
103+
MRU = 'MRU',
104+
MUR = 'MUR',
105+
MVR = 'MVR',
106+
MWK = 'MWK',
107+
MXN = 'MXN',
108+
MXV = 'MXV',
109+
MYR = 'MYR',
110+
MZN = 'MZN',
111+
NAD = 'NAD',
112+
NGN = 'NGN',
113+
NIO = 'NIO',
114+
NOK = 'NOK',
115+
NPR = 'NPR',
116+
NZD = 'NZD',
117+
OMR = 'OMR',
118+
PAB = 'PAB',
119+
PEN = 'PEN',
120+
PGK = 'PGK',
121+
PHP = 'PHP',
122+
PKR = 'PKR',
123+
PLN = 'PLN',
124+
PYG = 'PYG',
125+
QAR = 'QAR',
126+
RON = 'RON',
127+
RSD = 'RSD',
128+
RUB = 'RUB',
129+
RWF = 'RWF',
130+
SAR = 'SAR',
131+
SBD = 'SBD',
132+
SCR = 'SCR',
133+
SDG = 'SDG',
134+
SEK = 'SEK',
135+
SGD = 'SGD',
136+
SHP = 'SHP',
137+
SLE = 'SLE',
138+
SLL = 'SLL',
139+
SOS = 'SOS',
140+
SRD = 'SRD',
141+
SSP = 'SSP',
142+
STD = 'STD',
143+
STN = 'STN',
144+
SVC = 'SVC',
145+
SYP = 'SYP',
146+
SZL = 'SZL',
147+
THB = 'THB',
148+
TJS = 'TJS',
149+
TMT = 'TMT',
150+
TND = 'TND',
151+
TOP = 'TOP',
152+
TRY = 'TRY',
153+
TTD = 'TTD',
154+
TWD = 'TWD',
155+
TZS = 'TZS',
156+
UAH = 'UAH',
157+
UGX = 'UGX',
158+
USD = 'USD',
159+
USN = 'USN',
160+
UYI = 'UYI',
161+
UYU = 'UYU',
162+
UZS = 'UZS',
163+
VEF = 'VEF',
164+
VES = 'VES',
165+
VND = 'VND',
166+
VUV = 'VUV',
167+
WST = 'WST',
168+
XAF = 'XAF',
169+
XAG = 'XAG',
170+
XAU = 'XAU',
171+
XBA = 'XBA',
172+
XBB = 'XBB',
173+
XBC = 'XBC',
174+
XBD = 'XBD',
175+
XCD = 'XCD',
176+
XDR = 'XDR',
177+
XFU = 'XFU',
178+
XOF = 'XOF',
179+
XPD = 'XPD',
180+
XPF = 'XPF',
181+
XPT = 'XPT',
182+
XTS = 'XTS',
183+
XSU = 'XSU',
184+
XUA = 'XUA',
185+
YER = 'YER',
186+
ZAR = 'ZAR',
187+
ZMW = 'ZMW',
188+
ZWL = 'ZWL',
189+
}
190+
4191
export interface ProductSearchProperties {
5192
query: string;
6193
url?: string;
@@ -9,7 +196,8 @@ export interface ProductSearchProperties {
9196
export interface ProductProperties {
10197
id: string;
11198
title?: string;
12-
price?: string;
199+
price?: number | string;
200+
currency?: Currency;
13201
url?: string;
14202
categories?: Array<ProductCategory>;
15203
meta?: Record<string, string | number | boolean>;
@@ -23,15 +211,16 @@ export interface ProductCategory {
23211

24212
export interface OrderCompletedProperties {
25213
id?: string;
26-
revenue?: string;
214+
revenue?: number | string;
215+
currency?: Currency;
27216
products: Array<OrderCompletedProduct>;
28217
}
29218

30219
export interface OrderCompletedProduct {
31220
id: string;
32221
title?: string;
33222
url?: string;
34-
price?: number;
223+
price?: number | string;
35224
quantity?: number;
36225
}
37226

0 commit comments

Comments
 (0)