@moxtradeveloper/react-native-moxo-module 10.1.3 → 10.11.1

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Moxo
3
+ Copyright (c) 2026 Moxo
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,32 +1,34 @@
1
+ Moxo is an AI workflow automation platform for business operations.
2
+
1
3
  ![moxo](https://assets-global.website-files.com/612ecbcc615e87b0b9b38524/62037243f5ede375a8705a34_Moxo-Website-Button.svg)
2
4
 
3
5
  [ [Introduce](#introduce) • [Preparation](#preparation) • [Installation](#installation) • [Initialization](#initialization) • [Sample Code](#sample-code) • [API Doc](#api-doc)]
4
6
 
5
7
  ## Introduce
6
8
 
7
- **react-native-moxo-module** is a [moxo sdk](https://www.moxo.com/platform/sdks) react-native wrapper. Provide Moxo OneStop capabilities to your mobile app built on [React Native](https://reactnative.dev/)
9
+ **react-native-moxo-module** is a [moxo sdk](https://www.moxo.com/platform/sdks) react-native wrapper. Provide Moxo capabilities to your mobile app built on [React Native](https://reactnative.dev/)
8
10
 
9
11
  ### Supported Platforms
10
12
 
11
- * iOS 13.0+
12
- * Android 4.4+
13
+ * iOS 15.0+
14
+ * Android 7+
13
15
 
14
16
  ## Preparation
15
17
 
16
18
  Below sdk or tools are required before start to use react-native-moxo-module.
17
19
 
18
- * Node.js v14+
20
+ * Node.js v22 LTS and Later
19
21
  * Watchman
20
22
 
21
23
  ### Android
22
24
 
23
25
  * Android Studio
24
- * Android SDK v19+
26
+ * Android SDK v24+
25
27
 
26
28
  ### iOS
27
29
 
28
- * Xcode v14.3+
29
- * Cocoapod v1.11.0+
30
+ * Xcode v26+
31
+ * Cocoapod v1.16.2+
30
32
 
31
33
  For more react-native set up details, please ref to [react native official site](https://reactnative.dev/docs/environment-setup)
32
34
 
@@ -36,45 +38,6 @@ For more react-native set up details, please ref to [react native official site]
36
38
  npm install @moxtradeveloper/react-native-moxo-module
37
39
  ```
38
40
 
39
- ### iOS Specific Steps
40
-
41
- * Add moxo cocoapod repo as source into Podfile under your iOS project.
42
- * Change pod deployment platform to iOS 13
43
-
44
- Sample:
45
-
46
- ```ruby
47
- require_relative '../node_modules/react-native/scripts/react_native_pods'
48
- require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
49
- #Add moxo source here
50
- source 'https://maven.moxtra.com/repo/moxtra-specs.git'
51
-
52
- #Change platform version if is not iOS 13
53
- platform :ios, '13.0'
54
- install! 'cocoapods', :deterministic_uuids => false
55
-
56
- # Rest of the file.....
57
- ```
58
-
59
- Exception:
60
- ![pod_error](./docs/pod_error.png)
61
- if you getting this error post moxo plugin installation, please also add master cocoapod repo as source into Podfile under your iOS project.
62
- Usually is https://github.com/CocoaPods/Specs.git
63
-
64
- ```ruby
65
- require_relative '../node_modules/react-native/scripts/react_native_pods'
66
- require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
67
- #Add moxo source here
68
- source 'https://maven.moxtra.com/repo/moxtra-specs.git'
69
- source 'https://github.com/CocoaPods/Specs.git'
70
-
71
- #Change platform version if is not iOS 13
72
- platform :ios, '13.0'
73
- install! 'cocoapods', :deterministic_uuids => false
74
-
75
- # Rest of the file.....
76
- ```
77
-
78
41
  ## Initialization
79
42
 
80
43
  ### Login
@@ -6,7 +6,7 @@ buildscript {
6
6
  google()
7
7
  mavenCentral()
8
8
  maven() {
9
- url "https://maven.moxtra.com/nexus/content/groups/mep_public/"
9
+ url "https://mxrepo.moxo.com/repository/customer-maven-releases/"
10
10
  }
11
11
  }
12
12
 
@@ -23,7 +23,7 @@ rootProject.allprojects {
23
23
  mavenCentral()
24
24
  jcenter()
25
25
  maven() {
26
- url "https://maven.moxtra.com/nexus/content/groups/mep_public/"
26
+ url "https://mxrepo.moxo.com/repository/customer-maven-releases/"
27
27
  }
28
28
  }
29
29
  }
@@ -49,6 +49,7 @@ def getExtOrIntegerDefault(name) {
49
49
 
50
50
  android {
51
51
  compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
52
+ namespace "com.moxomodule"
52
53
 
53
54
  defaultConfig {
54
55
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
@@ -66,10 +67,17 @@ android {
66
67
  }
67
68
 
68
69
  compileOptions {
69
- sourceCompatibility JavaVersion.VERSION_1_8
70
- targetCompatibility JavaVersion.VERSION_1_8
70
+ sourceCompatibility JavaVersion.VERSION_17
71
+ targetCompatibility JavaVersion.VERSION_17
71
72
  }
72
73
 
74
+ kotlinOptions {
75
+ jvmTarget = "17"
76
+ }
77
+
78
+ buildFeatures {
79
+ buildConfig true
80
+ }
73
81
  }
74
82
 
75
83
  repositories {
@@ -148,7 +156,7 @@ dependencies {
148
156
  //noinspection GradleDynamicVersion
149
157
  implementation "com.facebook.react:react-native:+"
150
158
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
151
- implementation "com.moxtra:mep-sdk:10.1.3"
159
+ implementation "com.moxtra:mep-sdk:10.11.1"
152
160
  // From node_modules
153
161
  }
154
162
 
@@ -1,4 +1,4 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.moxomodule">
2
+ >
3
3
 
4
4
  </manifest>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moxtradeveloper/react-native-moxo-module",
3
- "version": "10.1.3",
4
- "description": "Plugin for adding Moxtra services to react-native Apps.",
3
+ "version": "10.11.1",
4
+ "description": "Plugin for adding Moxo services to React Native Apps.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
7
7
  "types": "lib/typescript/index.d.ts",
@@ -13,9 +13,11 @@
13
13
  "android",
14
14
  "ios",
15
15
  "cpp",
16
+ "scripts",
16
17
  "*.podspec",
17
18
  "!lib/typescript/example",
18
19
  "!ios/build",
20
+ "!ios/Frameworks",
19
21
  "!android/build",
20
22
  "!android/gradle",
21
23
  "!android/gradlew",
@@ -27,16 +29,16 @@
27
29
  "!**/.*"
28
30
  ],
29
31
  "scripts": {
32
+ "postinstall": "node scripts/download-mepsdk.js",
30
33
  "test": "jest",
31
34
  "typescript": "tsc --noEmit",
32
35
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
33
36
  "example": "yarn --cwd example",
34
37
  "bootstrap": "yarn example && yarn install && yarn example pods",
35
38
  "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
36
- "doc":"typedoc ./src/index.tsx --skipErrorChecking"
39
+ "doc": "typedoc ./src/index.tsx --skipErrorChecking"
37
40
  },
38
41
  "keywords": [
39
- "moxtra",
40
42
  "moxo",
41
43
  "mep",
42
44
  "chat",
@@ -46,12 +48,12 @@
46
48
  "ios",
47
49
  "android"
48
50
  ],
49
- "author": "john.hu <john.hu@moxo.com>",
51
+ "author": "Moxo Inc.",
50
52
  "license": "ISC",
51
53
  "bugs": {
52
- "url": "https://www.moxtra.com"
54
+ "url": "https://www.moxo.com"
53
55
  },
54
- "homepage": "https://www.moxtra.com",
56
+ "homepage": "https://www.moxo.com",
55
57
  "publishConfig": {
56
58
  "registry": "https://registry.npmjs.org/"
57
59
  },
@@ -158,5 +160,11 @@
158
160
  }
159
161
  ]
160
162
  ]
163
+ },
164
+ "moxoSdk": {
165
+ "ios": {
166
+ "version": "10.11.1",
167
+ "downloadUrl": "https://mxrepo.moxo.com/repository/customer-raw-releases/mepsdk/dynamic/Dynamic_MEPSDK_iOS_v${version}.zip"
168
+ }
161
169
  }
162
170
  }
@@ -11,13 +11,15 @@ Pod::Spec.new do |s|
11
11
  s.license = package["license"]
12
12
  s.authors = package["author"]
13
13
 
14
- s.platforms = { :ios => "13.0" }
15
- s.source = { :git => "https://github.com/johnhu-moxo/react-native-moxo-module.git", :tag => "#{s.version}" }
14
+ s.platforms = { :ios => "15.0" }
15
+ s.source = { :git => "https://github.com/Moxtra/react-native-moxo-module.git", :tag => "#{s.version}" }
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
17
17
  s.public_header_files = 'ios/*.h'
18
18
  s.swift_version = '5.0'
19
19
  s.dependency "React-Core"
20
- s.dependency 'MEPSDKDylib', '~> 10.1.3'
20
+
21
+ # MEPSDK is embedded directly - downloaded via npm postinstall
22
+ s.vendored_frameworks = 'ios/Frameworks/MEPSDK.xcframework'
21
23
 
22
24
  # Don't install the dependencies when we run `pod install` in the old architecture.
23
25
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
@@ -0,0 +1,29 @@
1
+ const os = require('os');
2
+ const path = require('path');
3
+ const child_process = require('child_process');
4
+
5
+ const root = path.resolve(__dirname, '..');
6
+ const args = process.argv.slice(2);
7
+ const options = {
8
+ cwd: process.cwd(),
9
+ env: process.env,
10
+ stdio: 'inherit',
11
+ encoding: 'utf-8',
12
+ };
13
+
14
+ if (os.type() === 'Windows_NT') {
15
+ options.shell = true;
16
+ }
17
+
18
+ let result;
19
+
20
+ if (process.cwd() !== root || args.length) {
21
+ // We're not in the root of the project, or additional arguments were passed
22
+ // In this case, forward the command to `yarn`
23
+ result = child_process.spawnSync('yarn', args, options);
24
+ } else {
25
+ // If `yarn` is run without arguments, perform bootstrap
26
+ result = child_process.spawnSync('yarn', ['bootstrap'], options);
27
+ }
28
+
29
+ process.exitCode = result.status;
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Downloads MEPSDK.xcframework from CDN
5
+ * This script runs automatically after npm install
6
+ *
7
+ * Configuration is read from package.json -> moxoSdk.ios
8
+ */
9
+
10
+ const https = require('https');
11
+ const http = require('http');
12
+ const fs = require('fs');
13
+ const path = require('path');
14
+ const { execSync } = require('child_process');
15
+
16
+ // Read configuration from package.json
17
+ const packageJson = require('../package.json');
18
+ const sdkConfig = packageJson.moxoSdk?.ios || {};
19
+
20
+ const MEPSDK_VERSION = sdkConfig.version || '10.6.1';
21
+ const MEPSDK_DOWNLOAD_URL = (sdkConfig.downloadUrl || '').replace(
22
+ '${version}',
23
+ MEPSDK_VERSION
24
+ );
25
+
26
+ const FRAMEWORK_DIR = path.join(__dirname, '..', 'ios', 'Frameworks');
27
+ const FRAMEWORK_PATH = path.join(FRAMEWORK_DIR, 'MEPSDKDylib.xcframework');
28
+ const ZIP_PATH = path.join(FRAMEWORK_DIR, 'MEPSDKDylib.xcframework.zip');
29
+
30
+ function downloadFile(url, dest) {
31
+ return new Promise((resolve, reject) => {
32
+ const protocol = url.startsWith('https') ? https : http;
33
+ const file = fs.createWriteStream(dest);
34
+
35
+ console.log(`Downloading from: ${url}`);
36
+
37
+ const request = protocol.get(url, (response) => {
38
+ // Handle redirects
39
+ if (response.statusCode === 301 || response.statusCode === 302) {
40
+ file.close();
41
+ fs.unlinkSync(dest);
42
+ return downloadFile(response.headers.location, dest)
43
+ .then(resolve)
44
+ .catch(reject);
45
+ }
46
+
47
+ if (response.statusCode !== 200) {
48
+ file.close();
49
+ fs.unlinkSync(dest);
50
+ reject(new Error(`Failed to download: HTTP ${response.statusCode}`));
51
+ return;
52
+ }
53
+
54
+ response.pipe(file);
55
+
56
+ file.on('finish', () => {
57
+ file.close();
58
+ resolve();
59
+ });
60
+ });
61
+
62
+ request.on('error', (err) => {
63
+ fs.unlink(dest, () => {});
64
+ reject(err);
65
+ });
66
+
67
+ file.on('error', (err) => {
68
+ fs.unlink(dest, () => {});
69
+ reject(err);
70
+ });
71
+ });
72
+ }
73
+
74
+ async function main() {
75
+ // Validate configuration
76
+ if (!MEPSDK_DOWNLOAD_URL) {
77
+ console.error(
78
+ 'āŒ Error: moxoSdk.ios.downloadUrl is not configured in package.json'
79
+ );
80
+ process.exit(1);
81
+ }
82
+
83
+ // Skip if framework already exists
84
+ if (fs.existsSync(FRAMEWORK_PATH)) {
85
+ console.log('MEPSDKDylib.xcframework already exists, skipping download.');
86
+ return;
87
+ }
88
+
89
+ console.log(`\nšŸ“¦ Downloading MEPSDKDylib ${MEPSDK_VERSION}...\n`);
90
+
91
+ // Create Frameworks directory
92
+ if (!fs.existsSync(FRAMEWORK_DIR)) {
93
+ fs.mkdirSync(FRAMEWORK_DIR, { recursive: true });
94
+ }
95
+
96
+ try {
97
+ // Download the zip file
98
+ await downloadFile(MEPSDK_DOWNLOAD_URL, ZIP_PATH);
99
+ console.log('Download complete. Extracting...');
100
+
101
+ // Extract the zip file
102
+ execSync(`unzip -o "${ZIP_PATH}" -d "${FRAMEWORK_DIR}"`, {
103
+ stdio: 'inherit',
104
+ });
105
+
106
+ // Clean up zip file
107
+ fs.unlinkSync(ZIP_PATH);
108
+
109
+ console.log('\nāœ… MEPSDKDylib.xcframework installed successfully!\n');
110
+ } catch (error) {
111
+ console.error('\nāŒ Failed to download MEPSDKDylib:', error.message);
112
+ console.error(
113
+ '\nPlease ensure the CDN URL is correct or manually download the framework.'
114
+ );
115
+ console.error(`Expected location: ${FRAMEWORK_PATH}\n`);
116
+ process.exit(1);
117
+ }
118
+ }
119
+
120
+ main();
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Workspace
3
- version = "1.0">
4
- </Workspace>