react-native-okhi 1.2.32-beta.1 → 1.2.32-beta.2
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 +2 -3
- package/README.md +15 -139
- package/{OkhiNitro.podspec → ReactNativeOkhi.podspec} +4 -15
- package/android/build.gradle +20 -90
- package/android/gradle.properties +5 -5
- package/android/src/main/java/com/okhi/OkhiModule.kt +336 -0
- package/android/src/main/java/com/okhi/OkhiPackage.kt +33 -0
- package/ios/OkHiWrapper.swift +348 -0
- package/ios/Okhi.h +5 -0
- package/ios/Okhi.mm +170 -0
- package/lib/commonjs/NativeOkhi.js +9 -0
- package/lib/commonjs/NativeOkhi.js.map +1 -0
- package/lib/commonjs/index.js +226 -34
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/NativeOkhi.js +5 -0
- package/lib/module/NativeOkhi.js.map +1 -0
- package/lib/module/index.js +211 -14
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeOkhi.d.ts +25 -0
- package/lib/typescript/commonjs/src/NativeOkhi.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +22 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/types.d.ts +22 -53
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/NativeOkhi.d.ts +25 -0
- package/lib/typescript/module/src/NativeOkhi.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +22 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/types.d.ts +81 -0
- package/lib/typescript/module/src/types.d.ts.map +1 -0
- package/package.json +98 -89
- package/src/NativeOkhi.ts +68 -0
- package/src/index.tsx +271 -0
- package/src/types.ts +74 -318
- package/android/CMakeLists.txt +0 -32
- package/android/fix-prefab.gradle +0 -51
- package/android/src/main/cpp/cpp-adapter.cpp +0 -6
- package/android/src/main/java/com/okhinitro/HybridOkhiNitro.kt +0 -260
- package/android/src/main/java/com/okhinitro/OkhiNitroPackage.kt +0 -20
- package/ios/Bridge.h +0 -8
- package/ios/HybridOkhiNitro.swift +0 -277
- package/lib/commonjs/functions.js +0 -84
- package/lib/commonjs/functions.js.map +0 -1
- package/lib/commonjs/helpers.js +0 -205
- package/lib/commonjs/helpers.js.map +0 -1
- package/lib/commonjs/specs/okhi-nitro.nitro.js +0 -6
- package/lib/commonjs/specs/okhi-nitro.nitro.js.map +0 -1
- package/lib/module/functions.js +0 -79
- package/lib/module/functions.js.map +0 -1
- package/lib/module/helpers.js +0 -189
- package/lib/module/helpers.js.map +0 -1
- package/lib/module/specs/okhi-nitro.nitro.js +0 -4
- package/lib/module/specs/okhi-nitro.nitro.js.map +0 -1
- package/lib/typescript/src/functions.d.ts +0 -9
- package/lib/typescript/src/functions.d.ts.map +0 -1
- package/lib/typescript/src/helpers.d.ts +0 -14
- package/lib/typescript/src/helpers.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -17
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/specs/okhi-nitro.nitro.d.ts +0 -25
- package/lib/typescript/src/specs/okhi-nitro.nitro.d.ts.map +0 -1
- package/lib/typescript/src/types.d.ts.map +0 -1
- package/nitro.json +0 -24
- package/nitrogen/generated/.gitattributes +0 -1
- package/nitrogen/generated/android/OkhiNitro+autolinking.cmake +0 -81
- package/nitrogen/generated/android/OkhiNitro+autolinking.gradle +0 -27
- package/nitrogen/generated/android/OkhiNitroOnLoad.cpp +0 -52
- package/nitrogen/generated/android/OkhiNitroOnLoad.hpp +0 -25
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_NitroOkHiSuccessResponse__std__optional_OkHiException_.hpp +0 -81
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_bool__std__optional_OkHiException_.hpp +0 -79
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string__std__optional_OkHiException_.hpp +0 -79
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__vector_std__string__.hpp +0 -96
- package/nitrogen/generated/android/c++/JHybridOkhiNitroSpec.cpp +0 -158
- package/nitrogen/generated/android/c++/JHybridOkhiNitroSpec.hpp +0 -79
- package/nitrogen/generated/android/c++/JNitroOkCollect.hpp +0 -70
- package/nitrogen/generated/android/c++/JNitroOkCollectConfig.hpp +0 -69
- package/nitrogen/generated/android/c++/JNitroOkCollectStyle.hpp +0 -65
- package/nitrogen/generated/android/c++/JNitroOkHiSuccessResponse.hpp +0 -61
- package/nitrogen/generated/android/c++/JOkHiAppContext.hpp +0 -65
- package/nitrogen/generated/android/c++/JOkHiAuth.hpp +0 -66
- package/nitrogen/generated/android/c++/JOkHiException.hpp +0 -61
- package/nitrogen/generated/android/c++/JOkHiLogin.hpp +0 -78
- package/nitrogen/generated/android/c++/JOkHiLoginConfiguration.hpp +0 -57
- package/nitrogen/generated/android/c++/JOkHiUser.hpp +0 -82
- package/nitrogen/generated/android/c++/JOkHiVerificationType.hpp +0 -65
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/Func_void_std__optional_NitroOkHiSuccessResponse__std__optional_OkHiException_.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/Func_void_std__optional_bool__std__optional_OkHiException_.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/Func_void_std__optional_std__string__std__optional_OkHiException_.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/Func_void_std__optional_std__vector_std__string__.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/HybridOkhiNitroSpec.kt +0 -183
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/NitroOkCollect.kt +0 -44
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/NitroOkCollectConfig.kt +0 -47
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/NitroOkCollectStyle.kt +0 -44
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/NitroOkHiSuccessResponse.kt +0 -41
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/OkHiAppContext.kt +0 -44
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/OkHiAuth.kt +0 -44
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/OkHiException.kt +0 -41
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/OkHiLogin.kt +0 -47
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/OkHiLoginConfiguration.kt +0 -38
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/OkHiUser.kt +0 -56
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/OkHiVerificationType.kt +0 -23
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/okhinitro/OkhiNitroOnLoad.kt +0 -35
- package/nitrogen/generated/ios/OkhiNitro+autolinking.rb +0 -60
- package/nitrogen/generated/ios/OkhiNitro-Swift-Cxx-Bridge.cpp +0 -65
- package/nitrogen/generated/ios/OkhiNitro-Swift-Cxx-Bridge.hpp +0 -271
- package/nitrogen/generated/ios/OkhiNitro-Swift-Cxx-Umbrella.hpp +0 -80
- package/nitrogen/generated/ios/OkhiNitroAutolinking.mm +0 -33
- package/nitrogen/generated/ios/OkhiNitroAutolinking.swift +0 -25
- package/nitrogen/generated/ios/c++/HybridOkhiNitroSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridOkhiNitroSpecSwift.hpp +0 -193
- package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroOkHiSuccessResponse__std__optional_OkHiException_.swift +0 -47
- package/nitrogen/generated/ios/swift/Func_void_std__optional_bool__std__optional_OkHiException_.swift +0 -54
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string__std__optional_OkHiException_.swift +0 -54
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__vector_std__string__.swift +0 -54
- package/nitrogen/generated/ios/swift/HybridOkhiNitroSpec.swift +0 -70
- package/nitrogen/generated/ios/swift/HybridOkhiNitroSpec_cxx.swift +0 -522
- package/nitrogen/generated/ios/swift/NitroOkCollect.swift +0 -77
- package/nitrogen/generated/ios/swift/NitroOkCollectConfig.swift +0 -69
- package/nitrogen/generated/ios/swift/NitroOkCollectStyle.swift +0 -58
- package/nitrogen/generated/ios/swift/NitroOkHiSuccessResponse.swift +0 -47
- package/nitrogen/generated/ios/swift/OkHiAppContext.swift +0 -58
- package/nitrogen/generated/ios/swift/OkHiAuth.swift +0 -77
- package/nitrogen/generated/ios/swift/OkHiException.swift +0 -47
- package/nitrogen/generated/ios/swift/OkHiLogin.swift +0 -93
- package/nitrogen/generated/ios/swift/OkHiLoginConfiguration.swift +0 -55
- package/nitrogen/generated/ios/swift/OkHiUser.swift +0 -140
- package/nitrogen/generated/ios/swift/OkHiVerificationType.swift +0 -48
- package/nitrogen/generated/shared/c++/HybridOkhiNitroSpec.cpp +0 -35
- package/nitrogen/generated/shared/c++/HybridOkhiNitroSpec.hpp +0 -93
- package/nitrogen/generated/shared/c++/NitroOkCollect.hpp +0 -89
- package/nitrogen/generated/shared/c++/NitroOkCollectConfig.hpp +0 -87
- package/nitrogen/generated/shared/c++/NitroOkCollectStyle.hpp +0 -83
- package/nitrogen/generated/shared/c++/NitroOkHiSuccessResponse.hpp +0 -79
- package/nitrogen/generated/shared/c++/OkHiAppContext.hpp +0 -83
- package/nitrogen/generated/shared/c++/OkHiAuth.hpp +0 -84
- package/nitrogen/generated/shared/c++/OkHiException.hpp +0 -79
- package/nitrogen/generated/shared/c++/OkHiLogin.hpp +0 -98
- package/nitrogen/generated/shared/c++/OkHiLoginConfiguration.hpp +0 -75
- package/nitrogen/generated/shared/c++/OkHiUser.hpp +0 -100
- package/nitrogen/generated/shared/c++/OkHiVerificationType.hpp +0 -84
- package/src/functions.ts +0 -110
- package/src/helpers.ts +0 -411
- package/src/index.ts +0 -235
- package/src/specs/okhi-nitro.nitro.ts +0 -79
package/LICENSE
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
4
|
-
|
|
3
|
+
Copyright (c) 2026 OkHi <kiano@okhi.co> (https://okhi.com)
|
|
5
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
7
6
|
in the Software without restriction, including without limitation the rights
|
|
@@ -18,4 +17,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
17
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
18
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
19
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
20
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,161 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<p align="left">
|
|
4
|
-
<strong>Address verification for emerging markets</strong>
|
|
5
|
-
<br />
|
|
6
|
-
Collect, verify, and manage user addresses with ease
|
|
7
|
-
</p>
|
|
8
|
-
|
|
9
|
-
<p align="left">
|
|
10
|
-
<a href="https://www.npmjs.com/package/react-native-okhi">
|
|
11
|
-
<img src="https://img.shields.io/npm/v/react-native-okhi.svg?style=flat-square&color=00B46E" alt="npm version" />
|
|
12
|
-
</a>
|
|
13
|
-
<a href="https://www.npmjs.com/package/react-native-okhi">
|
|
14
|
-
<img src="https://img.shields.io/npm/dm/react-native-okhi.svg?style=flat-square&color=00B46E" alt="npm downloads" />
|
|
15
|
-
</a>
|
|
16
|
-
<a href="https://github.com/OkHi/react-native-okhi/blob/master/LICENSE">
|
|
17
|
-
<img src="https://img.shields.io/npm/l/react-native-okhi.svg?style=flat-square&color=00B46E" alt="license" />
|
|
18
|
-
</a>
|
|
19
|
-
<img src="https://img.shields.io/badge/platforms-android%20|%20ios-lightgrey.svg?style=flat-square" alt="platforms" />
|
|
20
|
-
<img src="https://img.shields.io/badge/React%20Native-0.70+-blue.svg?style=flat-square" alt="react native version" />
|
|
21
|
-
</p>
|
|
22
|
-
|
|
23
|
-
<p align="left">
|
|
24
|
-
<a href="https://github.com/OkHi/react-native-okhi/actions">
|
|
25
|
-
<img src="https://img.shields.io/github/actions/workflow/status/OkHi/react-native-okhi/ci.yml?branch=master&style=flat-square&label=build" alt="build status" />
|
|
26
|
-
</a>
|
|
27
|
-
<a href="https://github.com/OkHi/react-native-okhi">
|
|
28
|
-
<img src="https://img.shields.io/badge/TypeScript-supported-blue.svg?style=flat-square" alt="typescript" />
|
|
29
|
-
</a>
|
|
30
|
-
</p>
|
|
1
|
+
# react-native-okhi
|
|
31
2
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Overview
|
|
35
|
-
|
|
36
|
-
The React Native OkHi SDK enables address verification for users in emerging markets where traditional addressing systems are unreliable. With just a few lines of code, you can:
|
|
37
|
-
|
|
38
|
-
- **Collect addresses** with an intuitive, map-based UI
|
|
39
|
-
- **Verify addresses** using digital signals, physical site visits, or both
|
|
40
|
-
- **Customize branding** to match your app's look and feel
|
|
3
|
+
The OkHi React Native library enables you to collect and verify addresses from your users
|
|
41
4
|
|
|
42
5
|
## Installation
|
|
43
6
|
|
|
44
|
-
```bash
|
|
45
|
-
npm install react-native-okhi react-native-nitro-modules
|
|
46
|
-
# or
|
|
47
|
-
yarn add react-native-okhi react-native-nitro-modules
|
|
48
|
-
```
|
|
49
7
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
cd ios && pod install
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Quick Start
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
import { login, startAddressVerification } from 'react-native-okhi';
|
|
60
|
-
|
|
61
|
-
// 1. Initialize after user authentication
|
|
62
|
-
await login({
|
|
63
|
-
auth: {
|
|
64
|
-
branchId: 'your-branch-id',
|
|
65
|
-
clientKey: 'your-client-key',
|
|
66
|
-
},
|
|
67
|
-
user: {
|
|
68
|
-
firstName: 'John',
|
|
69
|
-
lastName: 'Doe',
|
|
70
|
-
phone: '+254712345678',
|
|
71
|
-
email: 'john@example.com',
|
|
72
|
-
appUserId: 'user-123',
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// 2. Start address verification
|
|
77
|
-
const result = await startAddressVerification();
|
|
78
|
-
|
|
79
|
-
// 3. Store the location ID on your server
|
|
80
|
-
console.log('Location ID:', result.location.id);
|
|
8
|
+
```sh
|
|
9
|
+
npm install react-native-okhi
|
|
81
10
|
```
|
|
82
11
|
|
|
83
|
-
## Verification Types
|
|
84
|
-
|
|
85
|
-
| Type | Function | Description |
|
|
86
|
-
|------|----------|-------------|
|
|
87
|
-
| **Digital** | `startAddressVerification()` | Collects location signals from device |
|
|
88
|
-
| **Physical** | `startPhysicalAddressVerification()` | Triggers physical site visits |
|
|
89
|
-
| **Digital + Physical** | `startDigitalAndPhysicalAddressVerification()` | Combines both methods |
|
|
90
|
-
| **Address Book** | `createAddress()` | Stores address without verification |
|
|
91
12
|
|
|
92
|
-
##
|
|
13
|
+
## Usage
|
|
93
14
|
|
|
94
|
-
| Platform | Minimum Version |
|
|
95
|
-
|----------|-----------------|
|
|
96
|
-
| React Native | 0.70+ |
|
|
97
|
-
| Android | SDK 21 (Android 5.0) |
|
|
98
|
-
| iOS | 12.0+ |
|
|
99
|
-
| Node | 18.0+ |
|
|
100
15
|
|
|
101
|
-
|
|
16
|
+
```js
|
|
17
|
+
import { multiply } from 'react-native-okhi';
|
|
102
18
|
|
|
103
|
-
|
|
19
|
+
// ...
|
|
104
20
|
|
|
105
|
-
|
|
106
|
-
- **[OkHi Documentation](https://docs.okhi.com)** - Official API docs and guides
|
|
107
|
-
|
|
108
|
-
## API Reference
|
|
109
|
-
|
|
110
|
-
### Core Functions
|
|
111
|
-
|
|
112
|
-
```typescript
|
|
113
|
-
// Authentication
|
|
114
|
-
login(credentials: OkHiLogin): Promise<string[] | undefined>
|
|
115
|
-
logout(): Promise<void>
|
|
116
|
-
|
|
117
|
-
// Verification
|
|
118
|
-
startAddressVerification(params?): Promise<OkHiSuccessResponse>
|
|
119
|
-
startPhysicalAddressVerification(params?): Promise<OkHiSuccessResponse>
|
|
120
|
-
startDigitalAndPhysicalAddressVerification(params?): Promise<OkHiSuccessResponse>
|
|
121
|
-
createAddress(params?): Promise<OkHiSuccessResponse>
|
|
21
|
+
const result = multiply(3, 7);
|
|
122
22
|
```
|
|
123
23
|
|
|
124
|
-
### Response Type
|
|
125
|
-
|
|
126
|
-
```typescript
|
|
127
|
-
interface OkHiSuccessResponse {
|
|
128
|
-
user: OkHiUser;
|
|
129
|
-
location: OkHiLocation; // Contains location.id for tracking
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
## UI Customization
|
|
134
|
-
|
|
135
|
-
```typescript
|
|
136
|
-
await startAddressVerification({
|
|
137
|
-
okcollect: {
|
|
138
|
-
style: {
|
|
139
|
-
color: '#1A73E8', // Your brand color
|
|
140
|
-
name: 'Your App', // Display name
|
|
141
|
-
logo: 'https://...', // Logo URL
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
```
|
|
146
24
|
|
|
147
|
-
##
|
|
25
|
+
## Contributing
|
|
148
26
|
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
27
|
+
- [Development workflow](CONTRIBUTING.md#development-workflow)
|
|
28
|
+
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
|
|
29
|
+
- [Code of conduct](CODE_OF_CONDUCT.md)
|
|
152
30
|
|
|
153
31
|
## License
|
|
154
32
|
|
|
155
|
-
MIT
|
|
33
|
+
MIT
|
|
156
34
|
|
|
157
35
|
---
|
|
158
36
|
|
|
159
|
-
|
|
160
|
-
<sub>Built with love by <a href="https://okhi.com">OkHi</a> - AI-powered address verification for business</sub>
|
|
161
|
-
</p>
|
|
37
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
@@ -3,30 +3,19 @@ require "json"
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
4
|
|
|
5
5
|
Pod::Spec.new do |s|
|
|
6
|
-
s.name = "
|
|
6
|
+
s.name = "ReactNativeOkHi"
|
|
7
7
|
s.version = package["version"]
|
|
8
8
|
s.summary = package["description"]
|
|
9
9
|
s.homepage = package["homepage"]
|
|
10
10
|
s.license = package["license"]
|
|
11
11
|
s.authors = package["author"]
|
|
12
12
|
|
|
13
|
-
s.platforms = { :ios => min_ios_version_supported
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
14
|
s.source = { :git => "https://github.com/OkHi/react-native-okhi.git", :tag => "#{s.version}" }
|
|
15
15
|
|
|
16
|
-
s.source_files =
|
|
17
|
-
|
|
18
|
-
"ios/**/*.{swift}",
|
|
19
|
-
# Autolinking/Registration (Objective-C++)
|
|
20
|
-
"ios/**/*.{m,mm}",
|
|
21
|
-
# Implementation (C++ objects)
|
|
22
|
-
"cpp/**/*.{hpp,cpp}",
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
load 'nitrogen/generated/ios/OkhiNitro+autolinking.rb'
|
|
26
|
-
add_nitrogen_files(s)
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
|
|
17
|
+
s.private_header_files = "ios/**/*.h"
|
|
27
18
|
|
|
28
19
|
s.dependency "OkHi", "~> 1.10.5"
|
|
29
|
-
s.dependency 'React-jsi'
|
|
30
|
-
s.dependency 'React-callinvoker'
|
|
31
20
|
install_modules_dependencies(s)
|
|
32
21
|
end
|
package/android/build.gradle
CHANGED
|
@@ -1,99 +1,42 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Okhi_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
2
6
|
repositories {
|
|
3
7
|
google()
|
|
4
8
|
mavenCentral()
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
dependencies {
|
|
8
|
-
classpath "com.android.tools.build:gradle:8.
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
9
15
|
}
|
|
10
16
|
}
|
|
11
17
|
|
|
12
|
-
def reactNativeArchitectures() {
|
|
13
|
-
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
14
|
-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
def isNewArchitectureEnabled() {
|
|
18
|
-
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
19
|
-
}
|
|
20
18
|
|
|
21
19
|
apply plugin: "com.android.library"
|
|
22
|
-
apply plugin:
|
|
23
|
-
apply from: '../nitrogen/generated/android/OkhiNitro+autolinking.gradle'
|
|
24
|
-
apply from: "./fix-prefab.gradle"
|
|
25
|
-
|
|
26
|
-
if (isNewArchitectureEnabled()) {
|
|
27
|
-
apply plugin: "com.facebook.react"
|
|
28
|
-
}
|
|
20
|
+
apply plugin: "kotlin-android"
|
|
29
21
|
|
|
30
|
-
|
|
31
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["OkhiNitro_" + name]
|
|
32
|
-
}
|
|
22
|
+
apply plugin: "com.facebook.react"
|
|
33
23
|
|
|
34
24
|
def getExtOrIntegerDefault(name) {
|
|
35
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["
|
|
25
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Okhi_" + name]).toInteger()
|
|
36
26
|
}
|
|
37
27
|
|
|
38
28
|
android {
|
|
39
|
-
namespace "com.
|
|
29
|
+
namespace "com.okhi"
|
|
40
30
|
|
|
41
|
-
ndkVersion getExtOrDefault("ndkVersion")
|
|
42
31
|
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
43
32
|
|
|
44
33
|
defaultConfig {
|
|
45
34
|
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
46
35
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
47
|
-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
48
|
-
|
|
49
|
-
externalNativeBuild {
|
|
50
|
-
cmake {
|
|
51
|
-
cppFlags "-frtti -fexceptions -Wall -Wextra -fstack-protector-all"
|
|
52
|
-
arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
|
53
|
-
abiFilters (*reactNativeArchitectures())
|
|
54
|
-
|
|
55
|
-
buildTypes {
|
|
56
|
-
debug {
|
|
57
|
-
cppFlags "-O1 -g"
|
|
58
|
-
}
|
|
59
|
-
release {
|
|
60
|
-
cppFlags "-O2"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
externalNativeBuild {
|
|
68
|
-
cmake {
|
|
69
|
-
path "CMakeLists.txt"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
packagingOptions {
|
|
74
|
-
excludes = [
|
|
75
|
-
"META-INF",
|
|
76
|
-
"META-INF/**",
|
|
77
|
-
"**/libc++_shared.so",
|
|
78
|
-
"**/libfbjni.so",
|
|
79
|
-
"**/libjsi.so",
|
|
80
|
-
"**/libfolly_json.so",
|
|
81
|
-
"**/libfolly_runtime.so",
|
|
82
|
-
"**/libglog.so",
|
|
83
|
-
"**/libhermes.so",
|
|
84
|
-
"**/libhermes-executor-debug.so",
|
|
85
|
-
"**/libhermes_executor.so",
|
|
86
|
-
"**/libreactnative.so",
|
|
87
|
-
"**/libreactnativejni.so",
|
|
88
|
-
"**/libturbomodulejsijni.so",
|
|
89
|
-
"**/libreact_nativemodule_core.so",
|
|
90
|
-
"**/libjscexecutor.so"
|
|
91
|
-
]
|
|
92
36
|
}
|
|
93
37
|
|
|
94
38
|
buildFeatures {
|
|
95
39
|
buildConfig true
|
|
96
|
-
prefab true
|
|
97
40
|
}
|
|
98
41
|
|
|
99
42
|
buildTypes {
|
|
@@ -113,12 +56,10 @@ android {
|
|
|
113
56
|
|
|
114
57
|
sourceSets {
|
|
115
58
|
main {
|
|
116
|
-
|
|
117
|
-
java
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
]
|
|
121
|
-
}
|
|
59
|
+
java.srcDirs += [
|
|
60
|
+
"generated/java",
|
|
61
|
+
"generated/jni"
|
|
62
|
+
]
|
|
122
63
|
}
|
|
123
64
|
}
|
|
124
65
|
}
|
|
@@ -126,24 +67,13 @@ android {
|
|
|
126
67
|
repositories {
|
|
127
68
|
mavenCentral()
|
|
128
69
|
google()
|
|
70
|
+
maven { url "https://repo.okhi.io/artifactory/maven" }
|
|
129
71
|
}
|
|
130
72
|
|
|
73
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
131
74
|
|
|
132
75
|
dependencies {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
//noinspection GradleDynamicVersion
|
|
137
|
-
implementation "com.facebook.react:react-native:+"
|
|
138
|
-
|
|
139
|
-
// Add a dependency on NitroModules
|
|
140
|
-
implementation project(":react-native-nitro-modules")
|
|
76
|
+
implementation 'io.okhi.android:okhi:1.0.0'
|
|
77
|
+
implementation "com.facebook.react:react-android"
|
|
78
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
141
79
|
}
|
|
142
|
-
|
|
143
|
-
if (isNewArchitectureEnabled()) {
|
|
144
|
-
react {
|
|
145
|
-
jsRootDir = file("../src/")
|
|
146
|
-
libraryName = "OkhiNitro"
|
|
147
|
-
codegenJavaPackageName = "com.okhinitro"
|
|
148
|
-
}
|
|
149
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
Okhi_kotlinVersion=2.0.21
|
|
2
|
+
Okhi_minSdkVersion=21
|
|
3
|
+
Okhi_targetSdkVersion=34
|
|
4
|
+
Okhi_compileSdkVersion=35
|
|
5
|
+
Okhi_ndkVersion=27.1.12297006
|