@patra-cid/akaim-sdk-rn 0.4.16-denymsg.3
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/AkaimSdkRn.podspec +96 -0
- package/LICENSE +20 -0
- package/README.md +109 -0
- package/android/build.gradle +86 -0
- package/android/gradle.properties +8 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/akaimsdkrn/AkaimSdkRnModule.kt +1327 -0
- package/android/src/main/java/com/akaimsdkrn/AkaimSdkRnPackage.kt +33 -0
- package/android/src/main/java/com/akaimsdkrn/CallbackPromise.kt +27 -0
- package/android/src/main/java/com/akaimsdkrn/SendMsgCallBack.kt +32 -0
- package/android/src/main/java/com/akaimsdkrn/listener/AdvancedMsgListener.kt +36 -0
- package/android/src/main/java/com/akaimsdkrn/listener/BatchMsgListener.kt +16 -0
- package/android/src/main/java/com/akaimsdkrn/listener/InitSDKListener.kt +39 -0
- package/android/src/main/java/com/akaimsdkrn/listener/OnConversationListener.kt +40 -0
- package/android/src/main/java/com/akaimsdkrn/listener/OnFriendshipListener.kt +53 -0
- package/android/src/main/java/com/akaimsdkrn/listener/OnGroupListener.kt +52 -0
- package/android/src/main/java/com/akaimsdkrn/listener/SetCustomBusinessListener.kt +12 -0
- package/android/src/main/java/com/akaimsdkrn/listener/UploadFileCallbackListener.kt +52 -0
- package/android/src/main/java/com/akaimsdkrn/listener/UploadLogProgressListener.kt +20 -0
- package/android/src/main/java/com/akaimsdkrn/listener/UserListener.kt +28 -0
- package/android/src/main/java/com/akaimsdkrn/utils/Emitter.kt +78 -0
- package/ios/AkaimSdkRn.h +17 -0
- package/ios/AkaimSdkRn.mm +1622 -0
- package/ios/CallbackPromise.h +19 -0
- package/ios/CallbackPromise.mm +58 -0
- package/ios/CodeGenStructHelper.h +17 -0
- package/ios/ReactLazyVectorConverter.h +22 -0
- package/ios/SendMessageCallback.h +22 -0
- package/ios/SendMessageCallback.mm +67 -0
- package/ios/UploadFileCallback.h +21 -0
- package/ios/UploadFileCallback.mm +80 -0
- package/ios/UploadLogCallback.h +22 -0
- package/ios/UploadLogCallback.mm +44 -0
- package/lib/module/NativeAkaimSdkRn.js +153 -0
- package/lib/module/NativeAkaimSdkRn.js.map +1 -0
- package/lib/module/index.js +361 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeAkaimSdkRn.d.ts +947 -0
- package/lib/typescript/src/NativeAkaimSdkRn.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +118 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +171 -0
- package/src/NativeAkaimSdkRn.ts +1177 -0
- package/src/index.tsx +758 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "AkaimSdkRn"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/1nterdigital/akaim-sdk-rn.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
17
|
+
s.private_header_files = "ios/**/*.h"
|
|
18
|
+
|
|
19
|
+
akaim_core_version = "1.0.16-denymsg.3"
|
|
20
|
+
|
|
21
|
+
s.prepare_command = <<-CMD
|
|
22
|
+
if [ ! -d "ios/AkaIMCore.xcframework" ]; then
|
|
23
|
+
echo "Downloading AkaIMCore framework using GitHub CLI..."
|
|
24
|
+
|
|
25
|
+
# 检查 gh CLI 是否可用
|
|
26
|
+
if ! command -v gh >/dev/null 2>&1; then
|
|
27
|
+
echo "Error: GitHub CLI (gh) is not installed"
|
|
28
|
+
echo "Please install it with: brew install gh"
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# 检查 gh CLI 是否已认证
|
|
33
|
+
if ! gh auth status >/dev/null 2>&1; then
|
|
34
|
+
echo "Error: GitHub CLI is not authenticated"
|
|
35
|
+
echo "Please run: gh auth login"
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
echo "Using GitHub CLI to download release asset..."
|
|
40
|
+
echo "Repository: 1nterdigital/aka-client-core"
|
|
41
|
+
echo "Version: v#{akaim_core_version}"
|
|
42
|
+
echo "Pattern: AkaIMCore-#{akaim_core_version}.xcframework.zip"
|
|
43
|
+
|
|
44
|
+
# 使用 gh CLI 下载
|
|
45
|
+
gh release download v#{akaim_core_version} \
|
|
46
|
+
--repo 1nterdigital/aka-client-core \
|
|
47
|
+
--pattern "AkaIMCore-#{akaim_core_version}.xcframework.zip" \
|
|
48
|
+
--output AkaIMCore.zip
|
|
49
|
+
|
|
50
|
+
if [ $? -eq 0 ] && [ -f "AkaIMCore.zip" ]; then
|
|
51
|
+
file_size=$(stat -f%z AkaIMCore.zip 2>/dev/null || stat -c%s AkaIMCore.zip 2>/dev/null || echo "0")
|
|
52
|
+
echo "Downloaded file size: $file_size bytes"
|
|
53
|
+
|
|
54
|
+
if [ "$file_size" -gt 1000 ]; then
|
|
55
|
+
echo "Extracting framework..."
|
|
56
|
+
mkdir -p ios/
|
|
57
|
+
unzip -q AkaIMCore.zip -d ios/
|
|
58
|
+
rm AkaIMCore.zip
|
|
59
|
+
echo "AkaIMCore.xcframework extracted successfully"
|
|
60
|
+
else
|
|
61
|
+
echo "Download failed - file too small"
|
|
62
|
+
rm AkaIMCore.zip
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
65
|
+
else
|
|
66
|
+
echo "GitHub CLI download failed"
|
|
67
|
+
echo "Please check:"
|
|
68
|
+
echo "1. You have access to 1nterdigital/aka-client-core repository"
|
|
69
|
+
echo "2. Release v#{akaim_core_version} exists"
|
|
70
|
+
echo "3. File AkaIMCore-#{akaim_core_version}.xcframework.zip exists in the release"
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
else
|
|
74
|
+
echo "AkaIMCore.xcframework already exists, skipping download"
|
|
75
|
+
fi
|
|
76
|
+
CMD
|
|
77
|
+
|
|
78
|
+
s.vendored_frameworks = "ios/AkaIMCore.xcframework"
|
|
79
|
+
s.libraries = 'resolv'
|
|
80
|
+
s.static_framework = true
|
|
81
|
+
|
|
82
|
+
# 在新架构中,只需要显式声明 React-Core
|
|
83
|
+
# 其他依赖会通过 install_modules_dependencies 自动管理
|
|
84
|
+
s.dependency "React-Core"
|
|
85
|
+
|
|
86
|
+
s.pod_target_xcconfig = {
|
|
87
|
+
'CLANG_ENABLE_MODULES' => 'YES',
|
|
88
|
+
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++20',
|
|
89
|
+
'CLANG_CXX_LIBRARY' => 'libc++',
|
|
90
|
+
'OTHER_CFLAGS' => '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1',
|
|
91
|
+
'OTHER_CPLUSPLUSFLAGS' => '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
# 这个函数会自动处理包括 RCT-Folly, React-Codegen, RCTRequired, RCTTypeSafety 等在内的所有必要依赖
|
|
95
|
+
install_modules_dependencies(s)
|
|
96
|
+
end
|
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 peter
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# akaim-sdk-rn
|
|
2
|
+
|
|
3
|
+
akachat sdk react native
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
```sh
|
|
7
|
+
yarn install
|
|
8
|
+
cd example/ios && pod install
|
|
9
|
+
```
|
|
10
|
+
```sh
|
|
11
|
+
npm install akaim-sdk-rn
|
|
12
|
+
```
|
|
13
|
+
## Usage
|
|
14
|
+
```js
|
|
15
|
+
import { initSDK } from 'akaim-sdk-rn';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Install gh client brew install gh
|
|
19
|
+
* Set your Personal access tokens (classic)
|
|
20
|
+
* echo "${You Personal access tokens (classic)}" | gh auth login --with-token
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### find Simulator DeviceID And Build IOS Example
|
|
25
|
+
|
|
26
|
+
```shell
|
|
27
|
+
xcrun simctl list devices
|
|
28
|
+
```
|
|
29
|
+
```shell
|
|
30
|
+
xcodebuild -workspace AkaimSdkRnExample.xcworkspace \
|
|
31
|
+
-scheme AkaimSdkRnExample \
|
|
32
|
+
-configuration Debug \
|
|
33
|
+
-destination 'platform=iOS Simulator,id=${You Simulator DeviceID}' \
|
|
34
|
+
build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Enter the "example/ios" directory to compile and generate the CodeGen.
|
|
38
|
+
```shell
|
|
39
|
+
cd example/ios && \
|
|
40
|
+
rm -rf Pods build Podfile.lock \
|
|
41
|
+
pod install
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### IOS SDK Description
|
|
46
|
+
* The React Native Library TurboModule generates native code based on the index.tsx and NativeAkaimSdkRn.ts interface files.
|
|
47
|
+
* In the akaim-sdk-rn project, running `cd example/ios && pod install` generates the native code required by the project. The code can be viewed in the `build/generated/ios` directory.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
* Files with Callback are all implementations of client-core-sdk.
|
|
51
|
+
* For example CallbackPromise.h and CallbackPromise.mm
|
|
52
|
+
* implementation client-core-sdk aka_im_callback type Base interface
|
|
53
|
+
* When used again, he is a callback function of the core-sdk.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
* CodeGenStructHelper.h
|
|
57
|
+
* Calling a pointer to the structure type NSDictionary
|
|
58
|
+
NSDictionary *InitOptions = STRUCT_TO_DICT(JS::NativeAkaimSdkRn::InitOptions)
|
|
59
|
+
|
|
60
|
+
* Local XCode debugging
|
|
61
|
+
* install XCode
|
|
62
|
+
* yarn example start
|
|
63
|
+
* open example/ios/AkaimSdkRnExample.xcworkspace
|
|
64
|
+
* In the XCode interface, click "Run".
|
|
65
|
+

|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
* Build & Release
|
|
69
|
+
```shell
|
|
70
|
+
yarn prepare && yarn release
|
|
71
|
+
```
|
|
72
|
+
* It will be published to the github private npm repository after building and will automatically modify the version number.
|
|
73
|
+
After publishing, you need to update the package.json of the local repository
|
|
74
|
+
|
|
75
|
+
* Usage as dependency in other projects
|
|
76
|
+
* Create .npmrc file in the project
|
|
77
|
+
```txt
|
|
78
|
+
@1nterdigital:registry=https://npm.pkg.github.com/
|
|
79
|
+
//npm.pkg.github.com/:_authToken=${MY_GITHUB_TOKEN}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Install dependency
|
|
83
|
+
```shell
|
|
84
|
+
yarn add @1nterdigital/akaim-sdk-rn@0.1.2
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### View the data in the SQLite database.
|
|
91
|
+
* Download DBeaver Or IDEA And VSCode Plugin
|
|
92
|
+
* Android
|
|
93
|
+
```shell
|
|
94
|
+
# yarn example android
|
|
95
|
+
# check the database directory
|
|
96
|
+
adb shell run-as akaimsdkrn.example ls -l /data/user/0/akaimsdkrn.example/files/tmp/
|
|
97
|
+
# ================
|
|
98
|
+
# total 196
|
|
99
|
+
# -rw------- 1 u0_a226 u0_a226 192512 2025-10-02 15:28 AakIM_v3_5381946352.db
|
|
100
|
+
#===================
|
|
101
|
+
adb exec-out run-as akaimsdkrn.example cat /data/user/0/akaimsdkrn.example/files/tmp/AakIM_v3_5381946352.db > ./AakIM_v3_5381946352.db
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
* IOS
|
|
105
|
+
```shell
|
|
106
|
+
ls /Users/wei/Library/Developer/CoreSimulator/Devices/0D807DE1-2290-432F-8946-D9FCAA24EC15/data/Containers/Data/Application/9BCB3C07-B439-42C4-AB4A-E98A8F48F6CD/Documents/tmp
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+

|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['AkaimSdkRn_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
repositories {
|
|
7
|
+
google()
|
|
8
|
+
mavenCentral()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
apply plugin: "com.android.library"
|
|
20
|
+
apply plugin: "kotlin-android"
|
|
21
|
+
|
|
22
|
+
apply plugin: "com.facebook.react"
|
|
23
|
+
|
|
24
|
+
def getExtOrIntegerDefault(name) {
|
|
25
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["AkaimSdkRn_" + name]).toInteger()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
android {
|
|
29
|
+
namespace "com.akaimsdkrn"
|
|
30
|
+
|
|
31
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
32
|
+
|
|
33
|
+
defaultConfig {
|
|
34
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
35
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
buildFeatures {
|
|
39
|
+
buildConfig true
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
buildTypes {
|
|
43
|
+
release {
|
|
44
|
+
minifyEnabled false
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
lintOptions {
|
|
49
|
+
disable "GradleCompatible"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
compileOptions {
|
|
53
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
54
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
sourceSets {
|
|
58
|
+
main {
|
|
59
|
+
java.srcDirs += [
|
|
60
|
+
"generated/java",
|
|
61
|
+
"generated/jni"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
repositories {
|
|
68
|
+
mavenCentral()
|
|
69
|
+
google()
|
|
70
|
+
maven {
|
|
71
|
+
url "https://maven.pkg.github.com/1nterdigital/aka-client-core"
|
|
72
|
+
credentials {
|
|
73
|
+
username = project.findProperty("gpr.user") ?: System.getenv("GPR_USER")
|
|
74
|
+
password = project.findProperty("gpr.key") ?: System.getenv("GPR_KEY")
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
80
|
+
|
|
81
|
+
dependencies {
|
|
82
|
+
implementation "com.facebook.react:react-android"
|
|
83
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
84
|
+
implementation "com.interdigital.aka:akaimcore:1.0.16-denymsg.3"
|
|
85
|
+
implementation 'com.alibaba:fastjson:1.1.72.android'
|
|
86
|
+
}
|