Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 20.18.0
nodejs 22.14.0
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.movableink.sdk:inked:1.6.1"
implementation "com.movableink.sdk:inked:2.0.0"
}

if (isNewArchitectureEnabled()) {
Expand Down
13 changes: 6 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ PODS:
- hermes-engine/Pre-built (= 0.73.5)
- hermes-engine/Pre-built (0.73.5)
- libevent (2.1.12)
- MovableInk (1.7.3)
- MovableInk (2.0.0)
- OpenSSL-Universal (1.1.1100)
- RCT-Folly (2022.05.16.00):
- boost
Expand Down Expand Up @@ -945,8 +945,8 @@ PODS:
- React-Mapbuffer (0.73.5):
- glog
- React-debug
- react-native-movable-ink (1.6.2):
- MovableInk (= 1.7.3)
- react-native-movable-ink (2.0.0):
- MovableInk (= 2.0.0)
- React-Core
- React-nativeconfig (0.73.5)
- React-NativeModulesApple (0.73.5):
Expand Down Expand Up @@ -1199,8 +1199,6 @@ DEPENDENCIES:

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
- MovableInk
trunk:
- CocoaAsyncSocket
- Flipper
- Flipper-Boost-iOSX
Expand All @@ -1212,6 +1210,7 @@ SPEC REPOS:
- FlipperKit
- fmt
- libevent
- MovableInk
- OpenSSL-Universal
- SocketRocket

Expand Down Expand Up @@ -1336,7 +1335,7 @@ SPEC CHECKSUMS:
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
hermes-engine: 1d1835b2cc54c381909d94d1b3c8e0a2f1a94a0e
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
MovableInk: 523afbf0d08ed31ec35563ee053e9116e1129165
MovableInk: 1c6879a32b0fd2c03efa9c9460986bd2f233ef68
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0
RCTRequired: 2544c0f1081a5fa12e108bb8cb40e5f4581ccd87
Expand All @@ -1359,7 +1358,7 @@ SPEC CHECKSUMS:
React-jsinspector: 32db5e364bcae8fca8cdf8891830636275add0c5
React-logger: 4136cd22748f4275b04bf82f7b6853ba93b5e0e3
React-Mapbuffer: ee9b45b26e759a099a3e024df50b25af390ee998
react-native-movable-ink: f03032938b6d8f631213e563d4ce4839d63e7c47
react-native-movable-ink: 70fe2094c4746cefa1b2c3da57ea3e0822119516
React-nativeconfig: 1166714a4f7ea57a0df5c2cb44fbc70f98d580f9
React-NativeModulesApple: d4a50e6739e201716bc90178c143d019c8e09c36
React-perflogger: 0dd9f1725d55f8264b81efadd373fe1d9cca7dc2
Expand Down
23 changes: 21 additions & 2 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { StyleSheet, View, Text, Linking, Button } from 'react-native';
import RNMovableInk from '@movable/react-native-sdk';
import RNMovableInk, { Currency } from '@movable/react-native-sdk';

export default function App() {
const [link, setLink] = React.useState<string | undefined>();
Expand Down Expand Up @@ -70,7 +70,8 @@ export default function App() {
RNMovableInk.productAdded({
id: '123',
title: 'Test Product',
price: '$10.00',
price: 10.0,
currency: Currency.XTS,
meta: {
test_key: 'test_value',
test_key_two: true,
Expand All @@ -80,6 +81,24 @@ export default function App() {
}}
/>

<Button
title="Test Order Completed"
onPress={(_event) => {
RNMovableInk.orderCompleted({
id: '123',
revenue: '10.00',
currency: Currency.XTS,
products: [
{
id: '123',
title: 'Test Product',
price: '10.00',
},
],
});
}}
/>

<Button
title="Test Custom Event"
onPress={(_event) => {
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@movable/react-native-sdk",
"version": "1.6.2",
"version": "2.0.0",
"description": "MovableInk React Native SDK",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -37,7 +37,11 @@
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
},
"keywords": [
"movableink", "movable", "moveableink", "movable ink", "moveable ink"
"movableink",
"movable",
"moveableink",
"movable ink",
"moveable ink"
],
"repository": "https://github.com/movableink/mobile-sdk-react-native",
"author": "MovableInk <dev@movableink.com> (https://github.com/movableink)",
Expand Down
7 changes: 6 additions & 1 deletion react-native-movable-ink.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ Pod::Spec.new do |s|

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

s.dependency "MovableInk", "1.7.3"
# Enable when testing local pod
# s.dependency "MovableInk"

# Disable when testing local pod
s.dependency "MovableInk", "2.0.0"

s.dependency "React-Core"

# Don't install the dependencies when we run `pod install` in the old architecture.
Expand Down
195 changes: 192 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,193 @@
import { NativeModules } from 'react-native';
const { RNMovableInk } = NativeModules;

export enum Currency {
AED = 'AED',
AFN = 'AFN',
ALL = 'ALL',
AMD = 'AMD',
ANG = 'ANG',
AOA = 'AOA',
ARS = 'ARS',
AUD = 'AUD',
AWG = 'AWG',
AZN = 'AZN',
BAM = 'BAM',
BBD = 'BBD',
BDT = 'BDT',
BGN = 'BGN',
BHD = 'BHD',
BIF = 'BIF',
BMD = 'BMD',
BND = 'BND',
BOB = 'BOB',
BOV = 'BOV',
BRL = 'BRL',
BSD = 'BSD',
BTN = 'BTN',
BWP = 'BWP',
BYN = 'BYN',
BYR = 'BYR',
BZD = 'BZD',
CAD = 'CAD',
CDF = 'CDF',
CHF = 'CHF',
CLF = 'CLF',
CLP = 'CLP',
CNY = 'CNY',
COP = 'COP',
COU = 'COU',
CRC = 'CRC',
CUC = 'CUC',
CUP = 'CUP',
CVE = 'CVE',
CZK = 'CZK',
DJF = 'DJF',
DKK = 'DKK',
DOP = 'DOP',
DZD = 'DZD',
EEK = 'EEK',
EGP = 'EGP',
ERN = 'ERN',
ETB = 'ETB',
EUR = 'EUR',
FJD = 'FJD',
FKP = 'FKP',
GBP = 'GBP',
GEL = 'GEL',
GHS = 'GHS',
GIP = 'GIP',
GMD = 'GMD',
GNF = 'GNF',
GTQ = 'GTQ',
GYD = 'GYD',
HKD = 'HKD',
HNL = 'HNL',
HRK = 'HRK',
HTG = 'HTG',
HUF = 'HUF',
IDR = 'IDR',
ILS = 'ILS',
INR = 'INR',
IQD = 'IQD',
IRR = 'IRR',
ISK = 'ISK',
JMD = 'JMD',
JOD = 'JOD',
JPY = 'JPY',
KES = 'KES',
KGS = 'KGS',
KHR = 'KHR',
KMF = 'KMF',
KPW = 'KPW',
KRW = 'KRW',
KWD = 'KWD',
KYD = 'KYD',
KZT = 'KZT',
LAK = 'LAK',
LBP = 'LBP',
LKR = 'LKR',
LRD = 'LRD',
LSL = 'LSL',
LTL = 'LTL',
LVL = 'LVL',
LYD = 'LYD',
MAD = 'MAD',
MDL = 'MDL',
MGA = 'MGA',
MKD = 'MKD',
MMK = 'MMK',
MNT = 'MNT',
MOP = 'MOP',
MRO = 'MRO',
MRU = 'MRU',
MUR = 'MUR',
MVR = 'MVR',
MWK = 'MWK',
MXN = 'MXN',
MXV = 'MXV',
MYR = 'MYR',
MZN = 'MZN',
NAD = 'NAD',
NGN = 'NGN',
NIO = 'NIO',
NOK = 'NOK',
NPR = 'NPR',
NZD = 'NZD',
OMR = 'OMR',
PAB = 'PAB',
PEN = 'PEN',
PGK = 'PGK',
PHP = 'PHP',
PKR = 'PKR',
PLN = 'PLN',
PYG = 'PYG',
QAR = 'QAR',
RON = 'RON',
RSD = 'RSD',
RUB = 'RUB',
RWF = 'RWF',
SAR = 'SAR',
SBD = 'SBD',
SCR = 'SCR',
SDG = 'SDG',
SEK = 'SEK',
SGD = 'SGD',
SHP = 'SHP',
SLE = 'SLE',
SLL = 'SLL',
SOS = 'SOS',
SRD = 'SRD',
SSP = 'SSP',
STD = 'STD',
STN = 'STN',
SVC = 'SVC',
SYP = 'SYP',
SZL = 'SZL',
THB = 'THB',
TJS = 'TJS',
TMT = 'TMT',
TND = 'TND',
TOP = 'TOP',
TRY = 'TRY',
TTD = 'TTD',
TWD = 'TWD',
TZS = 'TZS',
UAH = 'UAH',
UGX = 'UGX',
USD = 'USD',
USN = 'USN',
UYI = 'UYI',
UYU = 'UYU',
UZS = 'UZS',
VEF = 'VEF',
VES = 'VES',
VND = 'VND',
VUV = 'VUV',
WST = 'WST',
XAF = 'XAF',
XAG = 'XAG',
XAU = 'XAU',
XBA = 'XBA',
XBB = 'XBB',
XBC = 'XBC',
XBD = 'XBD',
XCD = 'XCD',
XDR = 'XDR',
XFU = 'XFU',
XOF = 'XOF',
XPD = 'XPD',
XPF = 'XPF',
XPT = 'XPT',
XTS = 'XTS',
XSU = 'XSU',
XUA = 'XUA',
YER = 'YER',
ZAR = 'ZAR',
ZMW = 'ZMW',
ZWL = 'ZWL',
}

export interface ProductSearchProperties {
query: string;
url?: string;
Expand All @@ -9,7 +196,8 @@ export interface ProductSearchProperties {
export interface ProductProperties {
id: string;
title?: string;
price?: string;
price?: number | string;
currency?: Currency;
url?: string;
categories?: Array<ProductCategory>;
meta?: Record<string, string | number | boolean>;
Expand All @@ -23,15 +211,16 @@ export interface ProductCategory {

export interface OrderCompletedProperties {
id?: string;
revenue?: string;
revenue?: number | string;
currency?: Currency;
products: Array<OrderCompletedProduct>;
}

export interface OrderCompletedProduct {
id: string;
title?: string;
url?: string;
price?: number;
price?: number | string;
quantity?: number;
}

Expand Down