@haroldtran/react-native-pax 1.0.6 → 1.0.8
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/README.md +12 -7
- package/lib/commonjs/index.js +14 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +14 -6
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/package.json +4 -7
- package/src/index.tsx +22 -5
- package/ios/PaxPoslink.h +0 -12
- package/ios/PaxPoslink.mm +0 -27
- package/ios/PaxPoslink.xcodeproj/project.pbxproj +0 -274
- package/ios/PaxPoslink.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
- package/react-native-pax.podspec +0 -33
package/README.md
CHANGED
|
@@ -27,11 +27,13 @@ yarn add @haroldtran/react-native-pax
|
|
|
27
27
|
⚠️ **Note: iOS implementation is currently not complete. Only Android is fully supported at this time.**
|
|
28
28
|
|
|
29
29
|
1. Navigate to your iOS project directory and install pods:
|
|
30
|
+
|
|
30
31
|
```sh
|
|
31
32
|
cd ios && pod install
|
|
32
33
|
```
|
|
33
34
|
|
|
34
35
|
2. Make sure your iOS deployment target is 11.0 or higher in your `Podfile`:
|
|
36
|
+
|
|
35
37
|
```ruby
|
|
36
38
|
platform :ios, '11.0'
|
|
37
39
|
```
|
|
@@ -99,7 +101,6 @@ try {
|
|
|
99
101
|
}
|
|
100
102
|
```
|
|
101
103
|
|
|
102
|
-
|
|
103
104
|
### Process a Refund
|
|
104
105
|
|
|
105
106
|
```js
|
|
@@ -128,7 +129,6 @@ try {
|
|
|
128
129
|
}
|
|
129
130
|
```
|
|
130
131
|
|
|
131
|
-
|
|
132
132
|
### Close Batch
|
|
133
133
|
|
|
134
134
|
```js
|
|
@@ -148,6 +148,7 @@ try {
|
|
|
148
148
|
Initializes the connection to the PAX device.
|
|
149
149
|
|
|
150
150
|
**Parameters:**
|
|
151
|
+
|
|
151
152
|
- `ip` (string): Device IP address
|
|
152
153
|
|
|
153
154
|
**Returns:** `Promise<any>`
|
|
@@ -157,6 +158,7 @@ Initializes the connection to the PAX device.
|
|
|
157
158
|
Initiates a payment transaction.
|
|
158
159
|
|
|
159
160
|
**Parameters:**
|
|
161
|
+
|
|
160
162
|
- `id` (string, optional): Transaction ID
|
|
161
163
|
- `amount` (number): Payment amount in cents (e.g., 1000 = $10.00)
|
|
162
164
|
- `tip` (number, optional): Tip amount in cents (e.g., 150 = $1.50)
|
|
@@ -170,6 +172,7 @@ Initiates a payment transaction.
|
|
|
170
172
|
Initiates a refund transaction.
|
|
171
173
|
|
|
172
174
|
**Parameters:**
|
|
175
|
+
|
|
173
176
|
- `data` (object): Object containing:
|
|
174
177
|
- `amount` (number): The amount to refund in cents
|
|
175
178
|
|
|
@@ -180,6 +183,7 @@ Initiates a refund transaction.
|
|
|
180
183
|
Voids a transaction for the given amount.
|
|
181
184
|
|
|
182
185
|
**Parameters:**
|
|
186
|
+
|
|
183
187
|
- `data` (object): Object containing:
|
|
184
188
|
- `amount` (number): The amount to void in cents
|
|
185
189
|
|
|
@@ -193,17 +197,18 @@ Closes the current batch of transactions.
|
|
|
193
197
|
|
|
194
198
|
## Response Objects
|
|
195
199
|
|
|
196
|
-
|
|
197
200
|
### PaxResponseModel
|
|
198
201
|
|
|
199
202
|
The response object returned by all transaction functions. Key fields include:
|
|
200
203
|
|
|
201
204
|
**Status & Result:**
|
|
205
|
+
|
|
202
206
|
- `status` (boolean): Overall operation success status
|
|
203
207
|
- `isPaymentSuccess` (boolean): Payment-specific success flag
|
|
204
208
|
- `message` (string): Response message or error description
|
|
205
209
|
|
|
206
210
|
**Transaction Details:**
|
|
211
|
+
|
|
207
212
|
- `id` (string): Transaction ID
|
|
208
213
|
- `transactionId` (string): Global unique transaction identifier
|
|
209
214
|
- `transactionNo` (string): Transaction sequence number
|
|
@@ -211,23 +216,27 @@ The response object returned by all transaction functions. Key fields include:
|
|
|
211
216
|
- `transactionDateTime` (string): Date/time of transaction
|
|
212
217
|
|
|
213
218
|
**Card & Payment Info:**
|
|
219
|
+
|
|
214
220
|
- `cardType` (string): Card type/brand (e.g., VISA, MASTERCARD)
|
|
215
221
|
- `cardNumber` (string): Masked card number
|
|
216
222
|
- `cardHolder` (string): Card holder name
|
|
217
223
|
- `entryMethod` (string): How card was entered (SWIPED_MSD, CONTACT_CHIP, CONTACTLESS_CHIP, etc.)
|
|
218
224
|
|
|
219
225
|
**Amount Details:**
|
|
226
|
+
|
|
220
227
|
- `amount` (string): Transaction amount
|
|
221
228
|
- `tipAmount` (string): Tip amount
|
|
222
229
|
- `surcharge` (string): Additional fees/surcharge
|
|
223
230
|
|
|
224
231
|
**Additional Data:**
|
|
232
|
+
|
|
225
233
|
- `data` (object): Detailed response data including account info, trace info, AVS info, etc.
|
|
226
234
|
- `sn` (string): Serial number
|
|
227
235
|
|
|
228
236
|
### CreditTransactionType Enum
|
|
229
237
|
|
|
230
238
|
Available payment types:
|
|
239
|
+
|
|
231
240
|
- `CreditTransactionType.Credit` (1): Credit card transaction
|
|
232
241
|
- `CreditTransactionType.Debit` (2): Debit card transaction
|
|
233
242
|
- `CreditTransactionType.Empty` (0): Not set/default
|
|
@@ -263,7 +272,3 @@ MIT
|
|
|
263
272
|
## Support
|
|
264
273
|
|
|
265
274
|
For PAX device documentation and support, visit [PAX Developer Portal](https://developer.pax.us).
|
|
266
|
-
|
|
267
|
-
---
|
|
268
|
-
|
|
269
|
-
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
package/lib/commonjs/index.js
CHANGED
|
@@ -9,13 +9,21 @@ exports.makePayment = makePayment;
|
|
|
9
9
|
exports.makeRefund = makeRefund;
|
|
10
10
|
exports.makeVoid = makeVoid;
|
|
11
11
|
var _reactNative = require("react-native");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const PaxPosLink =
|
|
12
|
+
// This package is Android-only. Provide clear errors on non-Android platforms
|
|
13
|
+
const ANDROID_ONLY_ERROR = "The package '@haroldtran/react-native-pax' only supports Android.";
|
|
14
|
+
const LINKING_ERROR = `The package '@haroldtran/react-native-pax' doesn't seem to be linked. Make sure:\n\n` + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
15
|
+
const isAndroid = _reactNative.Platform.OS === 'android';
|
|
16
|
+
const PaxPosLink = isAndroid ? _reactNative.NativeModules.PaxPoslink ?? new Proxy({}, {
|
|
17
17
|
get() {
|
|
18
|
-
|
|
18
|
+
const err = new Error(LINKING_ERROR);
|
|
19
|
+
err.stack = '';
|
|
20
|
+
throw err;
|
|
21
|
+
}
|
|
22
|
+
}) : new Proxy({}, {
|
|
23
|
+
get() {
|
|
24
|
+
const err = new Error(ANDROID_ONLY_ERROR);
|
|
25
|
+
err.stack = '';
|
|
26
|
+
throw err;
|
|
19
27
|
}
|
|
20
28
|
});
|
|
21
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","ANDROID_ONLY_ERROR","LINKING_ERROR","isAndroid","Platform","OS","PaxPosLink","NativeModules","PaxPoslink","Proxy","get","err","Error","stack","initPOSLink","ip","makePayment","id","amount","tip","paymentType","ecrRefNum","payment","makeRefund","refund","makeVoid","void","makeCloseBatch","batchCloseout"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA;AACA,MAAMC,kBAAkB,GACtB,mEAAmE;AAErE,MAAMC,aAAa,GACjB,sFAAsF,GACtF,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,SAAS,GAAGC,qBAAQ,CAACC,EAAE,KAAK,SAAS;AAE3C,MAAMC,UAAU,GAAGH,SAAS,GACxBI,0BAAa,CAACC,UAAU,IACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAMC,GAAG,GAAG,IAAIC,KAAK,CAACV,aAAa,CAAC;IACpCS,GAAG,CAACE,KAAK,GAAG,EAAE;IACd,MAAMF,GAAG;EACX;AACF,CACF,CAAC,GACD,IAAIF,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAMC,GAAG,GAAG,IAAIC,KAAK,CAACX,kBAAkB,CAAC;IACzCU,GAAG,CAACE,KAAK,GAAG,EAAE;IACd,MAAMF,GAAG;EACX;AACF,CACF,CAAC;;AAEL;AACA;AACA;AACA;AACA;AACO,SAASG,WAAWA,CAACC,EAAU,EAAE;EACtC,OAAOT,UAAU,CAACQ,WAAW,CAACC,EAAE,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,WAAWA,CACzBC,EAAW,EACXC,MAAc,GAAG,CAAC,EAClBC,GAAY,EACZC,WAAoB,EACpBC,SAAkB,EACS;EAC3B,OAAOf,UAAU,CAACgB,OAAO,CAAC;IAAEL,EAAE;IAAEC,MAAM;IAAEC,GAAG;IAAEC,WAAW;IAAEC;EAAU,CAAC,CAAC;AACxE;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,UAAUA,CAACL,MAAc,EAA6B;EACpE,OAAOZ,UAAU,CAACkB,MAAM,CAAC;IAAEN;EAAO,CAAC,CAAC;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASO,QAAQA,CAACP,MAAc,EAA6B;EAClE,OAAOZ,UAAU,CAACoB,IAAI,CAAC;IAAER;EAAO,CAAC,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACO,SAASS,cAAcA,CAAA,EAA8B;EAC1D,OAAOrB,UAAU,CAACsB,aAAa,CAAC,CAAC;AACnC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { NativeModules, Platform } from 'react-native';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const PaxPosLink =
|
|
4
|
+
// This package is Android-only. Provide clear errors on non-Android platforms
|
|
5
|
+
const ANDROID_ONLY_ERROR = "The package '@haroldtran/react-native-pax' only supports Android.";
|
|
6
|
+
const LINKING_ERROR = `The package '@haroldtran/react-native-pax' doesn't seem to be linked. Make sure:\n\n` + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
7
|
+
const isAndroid = Platform.OS === 'android';
|
|
8
|
+
const PaxPosLink = isAndroid ? NativeModules.PaxPoslink ?? new Proxy({}, {
|
|
9
9
|
get() {
|
|
10
|
-
|
|
10
|
+
const err = new Error(LINKING_ERROR);
|
|
11
|
+
err.stack = '';
|
|
12
|
+
throw err;
|
|
13
|
+
}
|
|
14
|
+
}) : new Proxy({}, {
|
|
15
|
+
get() {
|
|
16
|
+
const err = new Error(ANDROID_ONLY_ERROR);
|
|
17
|
+
err.stack = '';
|
|
18
|
+
throw err;
|
|
11
19
|
}
|
|
12
20
|
});
|
|
13
21
|
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","ANDROID_ONLY_ERROR","LINKING_ERROR","isAndroid","OS","PaxPosLink","PaxPoslink","Proxy","get","err","Error","stack","initPOSLink","ip","makePayment","id","amount","tip","paymentType","ecrRefNum","payment","makeRefund","refund","makeVoid","void","makeCloseBatch","batchCloseout"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAGtD;AACA,MAAMC,kBAAkB,GACtB,mEAAmE;AAErE,MAAMC,aAAa,GACjB,sFAAsF,GACtF,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,SAAS,GAAGH,QAAQ,CAACI,EAAE,KAAK,SAAS;AAE3C,MAAMC,UAAU,GAAGF,SAAS,GACxBJ,aAAa,CAACO,UAAU,IACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAMC,GAAG,GAAG,IAAIC,KAAK,CAACR,aAAa,CAAC;IACpCO,GAAG,CAACE,KAAK,GAAG,EAAE;IACd,MAAMF,GAAG;EACX;AACF,CACF,CAAC,GACD,IAAIF,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAMC,GAAG,GAAG,IAAIC,KAAK,CAACT,kBAAkB,CAAC;IACzCQ,GAAG,CAACE,KAAK,GAAG,EAAE;IACd,MAAMF,GAAG;EACX;AACF,CACF,CAAC;;AAEL;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,WAAWA,CAACC,EAAU,EAAE;EACtC,OAAOR,UAAU,CAACO,WAAW,CAACC,EAAE,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CACzBC,EAAW,EACXC,MAAc,GAAG,CAAC,EAClBC,GAAY,EACZC,WAAoB,EACpBC,SAAkB,EACS;EAC3B,OAAOd,UAAU,CAACe,OAAO,CAAC;IAAEL,EAAE;IAAEC,MAAM;IAAEC,GAAG;IAAEC,WAAW;IAAEC;EAAU,CAAC,CAAC;AACxE;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,UAAUA,CAACL,MAAc,EAA6B;EACpE,OAAOX,UAAU,CAACiB,MAAM,CAAC;IAAEN;EAAO,CAAC,CAAC;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,QAAQA,CAACP,MAAc,EAA6B;EAClE,OAAOX,UAAU,CAACmB,IAAI,CAAC;IAAER;EAAO,CAAC,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASS,cAAcA,CAAA,EAA8B;EAC1D,OAAOpB,UAAU,CAACqB,aAAa,CAAC,CAAC;AACnC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAoC1C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,OAErC;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,GAAE,MAAU,EAClB,GAAG,CAAC,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC,CAE3B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAElE;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAE1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAoC1C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,OAErC;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,GAAE,MAAU,EAClB,GAAG,CAAC,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC,CAE3B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAElE;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAE1D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haroldtran/react-native-pax",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "React Native native module for PAX devices",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -12,12 +12,9 @@
|
|
|
12
12
|
"*.ts",
|
|
13
13
|
"*.js",
|
|
14
14
|
"android",
|
|
15
|
-
"ios",
|
|
16
15
|
"cpp",
|
|
17
16
|
"android/gradlew/wrapper/gradle-wrapper.properties",
|
|
18
|
-
"*.podspec",
|
|
19
17
|
"!lib/typescript/example",
|
|
20
|
-
"!ios/build",
|
|
21
18
|
"!android/build",
|
|
22
19
|
"!android/gradle",
|
|
23
20
|
"!android/gradlew",
|
|
@@ -33,7 +30,6 @@
|
|
|
33
30
|
"lefthook.yml",
|
|
34
31
|
"LICENSE",
|
|
35
32
|
"package.json",
|
|
36
|
-
"react-native-pax-poslink.podspec",
|
|
37
33
|
"README.md",
|
|
38
34
|
"tsconfig.build.json",
|
|
39
35
|
"tsconfig.json",
|
|
@@ -55,8 +51,9 @@
|
|
|
55
51
|
"pos",
|
|
56
52
|
"poslink",
|
|
57
53
|
"payment",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
54
|
+
"android",
|
|
55
|
+
"harold",
|
|
56
|
+
"haroldtran"
|
|
60
57
|
],
|
|
61
58
|
"repository": {
|
|
62
59
|
"type": "git",
|
package/src/index.tsx
CHANGED
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
import { NativeModules, Platform } from 'react-native';
|
|
2
2
|
import { PaxResponseModel } from './type';
|
|
3
3
|
|
|
4
|
+
// This package is Android-only. Provide clear errors on non-Android platforms
|
|
5
|
+
const ANDROID_ONLY_ERROR =
|
|
6
|
+
"The package '@haroldtran/react-native-pax' only supports Android.";
|
|
7
|
+
|
|
4
8
|
const LINKING_ERROR =
|
|
5
|
-
`The package '@haroldtran/react-native-pax' doesn't seem to be linked. Make sure
|
|
6
|
-
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
9
|
+
`The package '@haroldtran/react-native-pax' doesn't seem to be linked. Make sure:\n\n` +
|
|
7
10
|
'- You rebuilt the app after installing the package\n' +
|
|
8
11
|
'- You are not using Expo Go\n';
|
|
9
12
|
|
|
10
|
-
const
|
|
11
|
-
|
|
13
|
+
const isAndroid = Platform.OS === 'android';
|
|
14
|
+
|
|
15
|
+
const PaxPosLink = isAndroid
|
|
16
|
+
? NativeModules.PaxPoslink ??
|
|
17
|
+
new Proxy(
|
|
18
|
+
{},
|
|
19
|
+
{
|
|
20
|
+
get() {
|
|
21
|
+
const err = new Error(LINKING_ERROR);
|
|
22
|
+
err.stack = '';
|
|
23
|
+
throw err;
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
)
|
|
12
27
|
: new Proxy(
|
|
13
28
|
{},
|
|
14
29
|
{
|
|
15
30
|
get() {
|
|
16
|
-
|
|
31
|
+
const err = new Error(ANDROID_ONLY_ERROR);
|
|
32
|
+
err.stack = '';
|
|
33
|
+
throw err;
|
|
17
34
|
},
|
|
18
35
|
}
|
|
19
36
|
);
|
package/ios/PaxPoslink.h
DELETED
package/ios/PaxPoslink.mm
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#import "PaxPoslink.h"
|
|
2
|
-
|
|
3
|
-
@implementation PaxPoslink
|
|
4
|
-
RCT_EXPORT_MODULE()
|
|
5
|
-
|
|
6
|
-
// Example method
|
|
7
|
-
// See // https://reactnative.dev/docs/native-modules-ios
|
|
8
|
-
RCT_REMAP_METHOD(multiply,
|
|
9
|
-
multiplyWithA:(double)a withB:(double)b
|
|
10
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
11
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
12
|
-
{
|
|
13
|
-
NSNumber *result = @(a * b);
|
|
14
|
-
|
|
15
|
-
resolve(result);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Don't compile this code when we build for the old architecture.
|
|
19
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
20
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
21
|
-
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
22
|
-
{
|
|
23
|
-
return std::make_shared<facebook::react::NativePaxPoslinkSpecJSI>(params);
|
|
24
|
-
}
|
|
25
|
-
#endif
|
|
26
|
-
|
|
27
|
-
@end
|
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
// !$*UTF8*$!
|
|
2
|
-
{
|
|
3
|
-
archiveVersion = 1;
|
|
4
|
-
classes = {
|
|
5
|
-
};
|
|
6
|
-
objectVersion = 46;
|
|
7
|
-
objects = {
|
|
8
|
-
|
|
9
|
-
/* Begin PBXBuildFile section */
|
|
10
|
-
5E555C0D2413F4C50049A1A2 /* PaxPoslink.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* PaxPoslink.m */; };
|
|
11
|
-
/* End PBXBuildFile section */
|
|
12
|
-
|
|
13
|
-
/* Begin PBXCopyFilesBuildPhase section */
|
|
14
|
-
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
15
|
-
isa = PBXCopyFilesBuildPhase;
|
|
16
|
-
buildActionMask = 2147483647;
|
|
17
|
-
dstPath = "include/$(PRODUCT_NAME)";
|
|
18
|
-
dstSubfolderSpec = 16;
|
|
19
|
-
files = (
|
|
20
|
-
);
|
|
21
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
22
|
-
};
|
|
23
|
-
/* End PBXCopyFilesBuildPhase section */
|
|
24
|
-
|
|
25
|
-
/* Begin PBXFileReference section */
|
|
26
|
-
134814201AA4EA6300B7C361 /* libPaxPoslink.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPaxPoslink.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
27
|
-
B3E7B5881CC2AC0600A0062D /* PaxPoslink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaxPoslink.h; sourceTree = "<group>"; };
|
|
28
|
-
B3E7B5891CC2AC0600A0062D /* PaxPoslink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PaxPoslink.m; sourceTree = "<group>"; };
|
|
29
|
-
/* End PBXFileReference section */
|
|
30
|
-
|
|
31
|
-
/* Begin PBXFrameworksBuildPhase section */
|
|
32
|
-
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
33
|
-
isa = PBXFrameworksBuildPhase;
|
|
34
|
-
buildActionMask = 2147483647;
|
|
35
|
-
files = (
|
|
36
|
-
);
|
|
37
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
38
|
-
};
|
|
39
|
-
/* End PBXFrameworksBuildPhase section */
|
|
40
|
-
|
|
41
|
-
/* Begin PBXGroup section */
|
|
42
|
-
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
43
|
-
isa = PBXGroup;
|
|
44
|
-
children = (
|
|
45
|
-
134814201AA4EA6300B7C361 /* libPaxPoslink.a */,
|
|
46
|
-
);
|
|
47
|
-
name = Products;
|
|
48
|
-
sourceTree = "<group>";
|
|
49
|
-
};
|
|
50
|
-
58B511D21A9E6C8500147676 = {
|
|
51
|
-
isa = PBXGroup;
|
|
52
|
-
children = (
|
|
53
|
-
B3E7B5881CC2AC0600A0062D /* PaxPoslink.h */,
|
|
54
|
-
B3E7B5891CC2AC0600A0062D /* PaxPoslink.m */,
|
|
55
|
-
134814211AA4EA7D00B7C361 /* Products */,
|
|
56
|
-
);
|
|
57
|
-
sourceTree = "<group>";
|
|
58
|
-
};
|
|
59
|
-
/* End PBXGroup section */
|
|
60
|
-
|
|
61
|
-
/* Begin PBXNativeTarget section */
|
|
62
|
-
58B511DA1A9E6C8500147676 /* PaxPoslink */ = {
|
|
63
|
-
isa = PBXNativeTarget;
|
|
64
|
-
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "PaxPoslink" */;
|
|
65
|
-
buildPhases = (
|
|
66
|
-
58B511D71A9E6C8500147676 /* Sources */,
|
|
67
|
-
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
68
|
-
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
69
|
-
);
|
|
70
|
-
buildRules = (
|
|
71
|
-
);
|
|
72
|
-
dependencies = (
|
|
73
|
-
);
|
|
74
|
-
name = PaxPoslink;
|
|
75
|
-
productName = RCTDataManager;
|
|
76
|
-
productReference = 134814201AA4EA6300B7C361 /* libPaxPoslink.a */;
|
|
77
|
-
productType = "com.apple.product-type.library.static";
|
|
78
|
-
};
|
|
79
|
-
/* End PBXNativeTarget section */
|
|
80
|
-
|
|
81
|
-
/* Begin PBXProject section */
|
|
82
|
-
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
83
|
-
isa = PBXProject;
|
|
84
|
-
attributes = {
|
|
85
|
-
LastUpgradeCheck = 0920;
|
|
86
|
-
ORGANIZATIONNAME = Facebook;
|
|
87
|
-
TargetAttributes = {
|
|
88
|
-
58B511DA1A9E6C8500147676 = {
|
|
89
|
-
CreatedOnToolsVersion = 6.1.1;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "PaxPoslink" */;
|
|
94
|
-
compatibilityVersion = "Xcode 3.2";
|
|
95
|
-
developmentRegion = English;
|
|
96
|
-
hasScannedForEncodings = 0;
|
|
97
|
-
knownRegions = (
|
|
98
|
-
English,
|
|
99
|
-
en,
|
|
100
|
-
);
|
|
101
|
-
mainGroup = 58B511D21A9E6C8500147676;
|
|
102
|
-
productRefGroup = 58B511D21A9E6C8500147676;
|
|
103
|
-
projectDirPath = "";
|
|
104
|
-
projectRoot = "";
|
|
105
|
-
targets = (
|
|
106
|
-
58B511DA1A9E6C8500147676 /* PaxPoslink */,
|
|
107
|
-
);
|
|
108
|
-
};
|
|
109
|
-
/* End PBXProject section */
|
|
110
|
-
|
|
111
|
-
/* Begin PBXSourcesBuildPhase section */
|
|
112
|
-
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
113
|
-
isa = PBXSourcesBuildPhase;
|
|
114
|
-
buildActionMask = 2147483647;
|
|
115
|
-
files = (
|
|
116
|
-
B3E7B58A1CC2AC0600A0062D /* PaxPoslink.m in Sources */,
|
|
117
|
-
);
|
|
118
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
119
|
-
};
|
|
120
|
-
/* End PBXSourcesBuildPhase section */
|
|
121
|
-
|
|
122
|
-
/* Begin XCBuildConfiguration section */
|
|
123
|
-
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
124
|
-
isa = XCBuildConfiguration;
|
|
125
|
-
buildSettings = {
|
|
126
|
-
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
127
|
-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
128
|
-
CLANG_CXX_LIBRARY = "libc++";
|
|
129
|
-
CLANG_ENABLE_MODULES = YES;
|
|
130
|
-
CLANG_ENABLE_OBJC_ARC = YES;
|
|
131
|
-
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
132
|
-
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
133
|
-
CLANG_WARN_COMMA = YES;
|
|
134
|
-
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
135
|
-
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
136
|
-
CLANG_WARN_EMPTY_BODY = YES;
|
|
137
|
-
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
138
|
-
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
139
|
-
CLANG_WARN_INT_CONVERSION = YES;
|
|
140
|
-
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
141
|
-
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
142
|
-
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
143
|
-
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
144
|
-
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
145
|
-
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
146
|
-
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
147
|
-
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
148
|
-
COPY_PHASE_STRIP = NO;
|
|
149
|
-
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
150
|
-
ENABLE_TESTABILITY = YES;
|
|
151
|
-
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
152
|
-
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
153
|
-
GCC_DYNAMIC_NO_PIC = NO;
|
|
154
|
-
GCC_NO_COMMON_BLOCKS = YES;
|
|
155
|
-
GCC_OPTIMIZATION_LEVEL = 0;
|
|
156
|
-
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
157
|
-
"DEBUG=1",
|
|
158
|
-
"$(inherited)",
|
|
159
|
-
);
|
|
160
|
-
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
161
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
162
|
-
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
163
|
-
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
164
|
-
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
165
|
-
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
166
|
-
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
167
|
-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
168
|
-
MTL_ENABLE_DEBUG_INFO = YES;
|
|
169
|
-
ONLY_ACTIVE_ARCH = YES;
|
|
170
|
-
SDKROOT = iphoneos;
|
|
171
|
-
};
|
|
172
|
-
name = Debug;
|
|
173
|
-
};
|
|
174
|
-
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
175
|
-
isa = XCBuildConfiguration;
|
|
176
|
-
buildSettings = {
|
|
177
|
-
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
178
|
-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
179
|
-
CLANG_CXX_LIBRARY = "libc++";
|
|
180
|
-
CLANG_ENABLE_MODULES = YES;
|
|
181
|
-
CLANG_ENABLE_OBJC_ARC = YES;
|
|
182
|
-
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
183
|
-
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
184
|
-
CLANG_WARN_COMMA = YES;
|
|
185
|
-
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
186
|
-
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
187
|
-
CLANG_WARN_EMPTY_BODY = YES;
|
|
188
|
-
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
189
|
-
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
190
|
-
CLANG_WARN_INT_CONVERSION = YES;
|
|
191
|
-
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
192
|
-
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
193
|
-
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
194
|
-
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
195
|
-
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
196
|
-
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
197
|
-
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
198
|
-
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
199
|
-
COPY_PHASE_STRIP = YES;
|
|
200
|
-
ENABLE_NS_ASSERTIONS = NO;
|
|
201
|
-
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
202
|
-
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
203
|
-
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
204
|
-
GCC_NO_COMMON_BLOCKS = YES;
|
|
205
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
206
|
-
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
207
|
-
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
208
|
-
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
209
|
-
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
210
|
-
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
211
|
-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
212
|
-
MTL_ENABLE_DEBUG_INFO = NO;
|
|
213
|
-
SDKROOT = iphoneos;
|
|
214
|
-
VALIDATE_PRODUCT = YES;
|
|
215
|
-
};
|
|
216
|
-
name = Release;
|
|
217
|
-
};
|
|
218
|
-
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
219
|
-
isa = XCBuildConfiguration;
|
|
220
|
-
buildSettings = {
|
|
221
|
-
HEADER_SEARCH_PATHS = (
|
|
222
|
-
"$(inherited)",
|
|
223
|
-
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
224
|
-
"$(SRCROOT)/../../../React/**",
|
|
225
|
-
"$(SRCROOT)/../../react-native/React/**",
|
|
226
|
-
);
|
|
227
|
-
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
228
|
-
OTHER_LDFLAGS = "-ObjC";
|
|
229
|
-
PRODUCT_NAME = PaxPoslink;
|
|
230
|
-
SKIP_INSTALL = YES;
|
|
231
|
-
};
|
|
232
|
-
name = Debug;
|
|
233
|
-
};
|
|
234
|
-
58B511F11A9E6C8500147676 /* Release */ = {
|
|
235
|
-
isa = XCBuildConfiguration;
|
|
236
|
-
buildSettings = {
|
|
237
|
-
HEADER_SEARCH_PATHS = (
|
|
238
|
-
"$(inherited)",
|
|
239
|
-
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
240
|
-
"$(SRCROOT)/../../../React/**",
|
|
241
|
-
"$(SRCROOT)/../../react-native/React/**",
|
|
242
|
-
);
|
|
243
|
-
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
244
|
-
OTHER_LDFLAGS = "-ObjC";
|
|
245
|
-
PRODUCT_NAME = PaxPoslink;
|
|
246
|
-
SKIP_INSTALL = YES;
|
|
247
|
-
};
|
|
248
|
-
name = Release;
|
|
249
|
-
};
|
|
250
|
-
/* End XCBuildConfiguration section */
|
|
251
|
-
|
|
252
|
-
/* Begin XCConfigurationList section */
|
|
253
|
-
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "PaxPoslink" */ = {
|
|
254
|
-
isa = XCConfigurationList;
|
|
255
|
-
buildConfigurations = (
|
|
256
|
-
58B511ED1A9E6C8500147676 /* Debug */,
|
|
257
|
-
58B511EE1A9E6C8500147676 /* Release */,
|
|
258
|
-
);
|
|
259
|
-
defaultConfigurationIsVisible = 0;
|
|
260
|
-
defaultConfigurationName = Release;
|
|
261
|
-
};
|
|
262
|
-
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "PaxPoslink" */ = {
|
|
263
|
-
isa = XCConfigurationList;
|
|
264
|
-
buildConfigurations = (
|
|
265
|
-
58B511F01A9E6C8500147676 /* Debug */,
|
|
266
|
-
58B511F11A9E6C8500147676 /* Release */,
|
|
267
|
-
);
|
|
268
|
-
defaultConfigurationIsVisible = 0;
|
|
269
|
-
defaultConfigurationName = Release;
|
|
270
|
-
};
|
|
271
|
-
/* End XCConfigurationList section */
|
|
272
|
-
};
|
|
273
|
-
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
274
|
-
}
|
package/react-native-pax.podspec
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
require "json"
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
|
-
|
|
6
|
-
Pod::Spec.new do |s|
|
|
7
|
-
s.name = "react-native-pax"
|
|
8
|
-
s.version = package["version"]
|
|
9
|
-
s.summary = package["description"]
|
|
10
|
-
s.homepage = package["homepage"]
|
|
11
|
-
s.license = package["license"]
|
|
12
|
-
s.authors = package["author"]
|
|
13
|
-
s.source = { :git => "https://github.com/phattran1201/react-native-pax.git", :tag => "#{s.version}" }
|
|
14
|
-
|
|
15
|
-
s.platforms = { :ios => "12.0" }
|
|
16
|
-
s.source_files = "ios/**/*.{h,m,mm}"
|
|
17
|
-
s.dependency "React-Core"
|
|
18
|
-
|
|
19
|
-
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
20
|
-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
21
|
-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
22
|
-
s.pod_target_xcconfig = {
|
|
23
|
-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
24
|
-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
25
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
26
|
-
}
|
|
27
|
-
s.dependency "React-Codegen"
|
|
28
|
-
s.dependency "RCT-Folly"
|
|
29
|
-
s.dependency "RCTRequired"
|
|
30
|
-
s.dependency "RCTTypeSafety"
|
|
31
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
32
|
-
end
|
|
33
|
-
end
|