tirtc-react-native 2.3.1 → 2.4.0-alpha.4

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.
Files changed (77) hide show
  1. package/README.md +23 -7
  2. package/TiRtcReactNative.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/AndroidManifest.xml +2 -1
  5. package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcModule.kt +622 -28
  6. package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeCleanup.kt +115 -0
  7. package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeEventBinder.kt +32 -8
  8. package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeEventSink.kt +16 -0
  9. package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeMaps.kt +62 -0
  10. package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeModuleSupport.kt +6 -6
  11. package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeRegistry.kt +27 -0
  12. package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeStorageSupport.kt +64 -0
  13. package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcVideoOutputViewManager.kt +17 -2
  14. package/ios/TiRtcReactNative+Conn.mm +173 -2
  15. package/ios/TiRtcReactNative+Input.mm +18 -4
  16. package/ios/TiRtcReactNative+Output.mm +41 -4
  17. package/ios/TiRtcReactNative+Private.h +4 -0
  18. package/ios/TiRtcReactNative+Storage.mm +513 -0
  19. package/ios/TiRtcReactNative.h +2 -1
  20. package/ios/TiRtcReactNative.mm +109 -1
  21. package/ios/TiRtcReactNativeEventBinder.h +8 -0
  22. package/ios/TiRtcReactNativeEventBinder.mm +102 -0
  23. package/ios/TiRtcReactNativeEventSink.h +3 -0
  24. package/ios/TiRtcReactNativeEventSink.mm +16 -0
  25. package/ios/TiRtcReactNativeRegistry.h +5 -0
  26. package/ios/TiRtcReactNativeRegistry.mm +43 -0
  27. package/ios/TiRtcVideoOutputView.mm +11 -0
  28. package/lib/module/audio_input.js +33 -17
  29. package/lib/module/audio_input.js.map +1 -1
  30. package/lib/module/audio_output.js +27 -10
  31. package/lib/module/audio_output.js.map +1 -1
  32. package/lib/module/conn.js +31 -7
  33. package/lib/module/conn.js.map +1 -1
  34. package/lib/module/errors.js +4 -3
  35. package/lib/module/errors.js.map +1 -1
  36. package/lib/module/index.js +2 -0
  37. package/lib/module/index.js.map +1 -1
  38. package/lib/module/logging.js +9 -1
  39. package/lib/module/logging.js.map +1 -1
  40. package/lib/module/logging_internal.js +27 -0
  41. package/lib/module/logging_internal.js.map +1 -0
  42. package/lib/module/recording.js +210 -0
  43. package/lib/module/recording.js.map +1 -0
  44. package/lib/module/runtime.js +13 -5
  45. package/lib/module/runtime.js.map +1 -1
  46. package/lib/module/specs/NativeTiRtc.js.map +1 -1
  47. package/lib/module/storage.js +706 -0
  48. package/lib/module/storage.js.map +1 -0
  49. package/lib/module/video_input.js +40 -22
  50. package/lib/module/video_input.js.map +1 -1
  51. package/lib/module/video_output.js +51 -10
  52. package/lib/module/video_output.js.map +1 -1
  53. package/lib/typescript/audio_input.d.ts +1 -0
  54. package/lib/typescript/conn.d.ts +2 -0
  55. package/lib/typescript/errors.d.ts +3 -2
  56. package/lib/typescript/index.d.ts +4 -0
  57. package/lib/typescript/logging_internal.d.ts +2 -0
  58. package/lib/typescript/recording.d.ts +53 -0
  59. package/lib/typescript/runtime.d.ts +2 -0
  60. package/lib/typescript/specs/NativeTiRtc.d.ts +88 -0
  61. package/lib/typescript/storage.d.ts +204 -0
  62. package/lib/typescript/video_input.d.ts +1 -0
  63. package/lib/typescript/video_output.d.ts +3 -0
  64. package/package.json +1 -1
  65. package/src/audio_input.ts +85 -59
  66. package/src/audio_output.ts +30 -17
  67. package/src/conn.ts +46 -28
  68. package/src/errors.ts +4 -3
  69. package/src/index.ts +54 -0
  70. package/src/logging.ts +7 -1
  71. package/src/logging_internal.ts +23 -0
  72. package/src/recording.ts +271 -0
  73. package/src/runtime.ts +14 -5
  74. package/src/specs/NativeTiRtc.ts +123 -0
  75. package/src/storage.ts +769 -0
  76. package/src/video_input.ts +97 -62
  77. package/src/video_output.ts +54 -16
package/README.md CHANGED
@@ -1,14 +1,16 @@
1
1
  # TiRTC React Native SDK
2
2
 
3
- `tirtc-react-native` is the TiRTC React Native New Architecture package for Android and iOS.
3
+ `tirtc-react-native` is the TiRTC and Ti Cloud Storage React Native New Architecture package for Android and iOS.
4
4
 
5
5
  ```sh
6
6
  npm install tirtc-react-native
7
7
  ```
8
8
 
9
- The package ships ESM JavaScript, TypeScript declarations, Codegen specs, Android native wrapper code and iOS native wrapper code. It requires React Native `>=0.80.0`, Android `com.tange.ai:tirtc:2.3.1`, and iOS `TiRTC` `2.3.1` with iOS minimum `15.1`.
9
+ The package ships ESM JavaScript, TypeScript declarations, Codegen specs, Android native wrapper code and iOS native wrapper code. RTC and CloudStorage use the same native Runtime delivery but keep separate initialization and resource lifecycles. The package requires React Native `>=0.80.0`, Android `com.tange.ai:tirtc:2.4.0-alpha.4`, and iOS `TiRTC` `2.4.0-alpha.4` with iOS minimum `15.1`.
10
10
 
11
- Version `2.3.1` is a stable React Native release aligned with the TiRTC 2.3.1 Android and Darwin SDKs.
11
+ The iOS package supports arm64 devices and Apple Silicon iOS Simulator. Simulator validation covers build, launch, connection, downlink audio, and downlink video; capture and iOS behavioral qualification remain real-device gates.
12
+
13
+ Version `2.4.0-alpha.4` is an alpha React Native release aligned with the TiRTC 2.4.0-alpha.4 Android and Darwin SDKs.
12
14
 
13
15
  ## Imports
14
16
 
@@ -54,7 +56,7 @@ The SDK reports platform failures through numeric TiRTC return codes and callbac
54
56
  import React from 'react';
55
57
  import {TiRtc, TiRtcConn, TiRtcVideoOutput, TiRtcVideoOutputView} from 'tirtc-react-native';
56
58
 
57
- await TiRtc.initialize({appId, endpoint});
59
+ await TiRtc.init({appId, endpoint});
58
60
 
59
61
  const conn = new TiRtcConn();
60
62
  const videoOutput = new TiRtcVideoOutput();
@@ -73,6 +75,8 @@ export function RemoteVideo() {
73
75
  }
74
76
  ```
75
77
 
78
+ `TiRtc.initialize(...)` remains available as a deprecated forwarding alias to `TiRtc.init(...)`.
79
+
76
80
  Dispose in reverse ownership order:
77
81
 
78
82
  ```ts
@@ -115,15 +119,27 @@ export function LocalPreview() {
115
119
  }
116
120
  ```
117
121
 
122
+ ## Saving Temporary Media
123
+
124
+ RTC recordings, RTC snapshots, CloudStorage recordings, and CloudStorage snapshots return temporary cache file objects. Publish one to the Android or iOS system media library with an optional final filename:
125
+
126
+ ```ts
127
+ const result = await file.moveToGallery(
128
+ '客厅角落摄像头-2026-08-20-14-30-05-123.mp4',
129
+ );
130
+ ```
131
+
132
+ The package does not declare or request gallery permissions. The application must prepare Android or iOS authorization before calling this method. Omit the filename to use an epoch-millisecond name; a missing `.mp4` or `.jpg` extension is appended automatically. Invalid names resolve with code `6000` without invoking the native module or deleting the cache source. A successful move deletes the source and returns an opaque `content://` or `ph://` URI; a failed move keeps the source available for retry.
133
+
118
134
  ## Errors And Lifecycle
119
135
 
120
136
  Public methods return numeric TiRTC codes instead of throwing for SDK failures. `0` means success. Use `TiRtc.errorToString(code)` or `TiRtc.formatError(code)` for display and logs.
121
137
 
122
- Constructors create native owner identities, so outputs and inputs can attach to a `TiRtcConn` before `connect(...)`. `dispose()` releases the native object only after the underlying stop/destroy call returns success. Calling `dispose()` again after success is valid and returns success; methods called after a successful dispose return the object released code. Input/output/view ownership is tracked by native object id plus generation so stale callbacks or recycled ids do not attach to a newer object.
138
+ Constructors create native owner identities, so outputs and inputs can attach to a `TiRtcConn` before `connect(...)`. `dispose()` releases the native object only after the underlying stop/destroy call returns success. Calling `dispose()` again after success is valid and returns success; methods called after a successful dispose return the not-initialized code. Input/output/view ownership is tracked by native object id plus generation so stale callbacks or recycled ids do not attach to a newer object.
123
139
 
124
140
  ## Release
125
141
 
126
- Version `2.3.1` is the current React Native package for TiRTC client media output and talkback. It supports React Native New Architecture apps on Android and iOS and pins Android `com.tange.ai:tirtc:2.3.1` and iOS `TiRTC` `2.3.1`.
142
+ Version `2.4.0-alpha.4` is the current React Native package for TiRTC client media output and talkback. It supports React Native New Architecture apps on Android and iOS and pins Android `com.tange.ai:tirtc:2.4.0-alpha.4` and iOS `TiRTC` `2.4.0-alpha.4`.
127
143
 
128
144
  ## License
129
145
 
@@ -143,7 +159,7 @@ The external application sample is published under `react-native/` in
143
159
  `tirtc-api-samples`. The owner-local projection and recovery entry is:
144
160
 
145
161
  ```sh
146
- ./scripts/publish_api_samples.sh --version 2.3.1
162
+ ./scripts/publish_api_samples.sh --version 2.4.0-alpha.4
147
163
  ```
148
164
 
149
165
  Use `--no-push` for a complete local projection/build rehearsal without writing
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
13
13
  s.source = { :git => 'https://gitlab.tange-ai.com/tirtc-nexus/tirtc.git', :tag => s.version.to_s }
14
14
  s.source_files = 'ios/**/*.{h,m,mm,swift}'
15
15
  s.dependency 'React-Core'
16
- s.dependency 'TiRTC', '2.3.1'
16
+ s.dependency 'TiRTC', '2.4.0-alpha.4'
17
17
 
18
18
  if respond_to?(:install_modules_dependencies, true)
19
19
  install_modules_dependencies(s)
@@ -29,7 +29,7 @@ repositories {
29
29
 
30
30
  dependencies {
31
31
  implementation "com.facebook.react:react-android"
32
- implementation "com.tange.ai:tirtc:${safeExtGet("tirtcAndroidVersion", "2.3.1")}"
32
+ implementation "com.tange.ai:tirtc:${safeExtGet("tirtcAndroidVersion", "2.4.0-alpha.4")}"
33
33
  }
34
34
 
35
35
  def safeExtGet(prop, fallback) {
@@ -1 +1,2 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android" />
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>