@tencent-rtc/mcp 1.6.3 → 1.6.5

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 (250) hide show
  1. package/index.js +0 -4
  2. package/knowledge/chunker.js +83 -54
  3. package/knowledge/path-meta.js +179 -26
  4. package/knowledge/search/exact-lookup.js +153 -0
  5. package/knowledge/search/filter-pool.js +73 -19
  6. package/knowledge/search/product-scope-intent.js +2 -2
  7. package/knowledge/search/requires-framework.js +2 -2
  8. package/knowledge/search/search-knowledge.js +235 -58
  9. package/package.json +1 -1
  10. package/resource/index/manifest.json +1 -1
  11. package/resource/integration/callkit/preset/android/integration.md +2 -4
  12. package/resource/integration/callkit/preset/flutter/integration.md +4 -5
  13. package/resource/integration/callkit/preset/ios/integration.md +1 -4
  14. package/resource/integration/callkit/preset/react/integration.md +13 -20
  15. package/resource/integration/callkit/preset/vue/integration.md +14 -21
  16. package/resource/integration/chat/preset/android/integration.md +6 -9
  17. package/resource/integration/chat/preset/flutter/integration.md +9 -12
  18. package/resource/integration/chat/preset/ios/integration.md +2 -4
  19. package/resource/integration/chat/preset/react/integration.md +0 -10
  20. package/resource/integration/livekit/preset/live/android/live-audience-integration.md +129 -0
  21. package/resource/integration/livekit/preset/live/android/live-host-integration.md +219 -0
  22. package/resource/integration/livekit/preset/live/android/live-list-integration.md +261 -0
  23. package/resource/integration/livekit/preset/live/android/prepare-integration.md +254 -0
  24. package/resource/integration/livekit/preset/live/ios/live-audience-integration.md +202 -0
  25. package/resource/integration/livekit/preset/live/ios/live-host-integration.md +369 -0
  26. package/resource/integration/livekit/preset/live/ios/live-list-integration.md +229 -0
  27. package/resource/integration/livekit/preset/live/ios/prepare-integration.md +204 -0
  28. package/resource/integration/livekit/preset/live/vue/live-list-integration.md +0 -3
  29. package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +0 -5
  30. package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +0 -6
  31. package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +5 -10
  32. package/resource/integration/roomkit/preset/vue/integration.md +0 -4
  33. package/resource/knowledge/callkit/best-practice/web/callengine-invitation.md +80 -0
  34. package/resource/knowledge/callkit/best-practice/web/callengine-log-control.md +24 -0
  35. package/resource/knowledge/callkit/best-practice/web/callkit-call-vs-calls.md +116 -0
  36. package/resource/knowledge/callkit/core-sdk/android/answer-call.md +7 -8
  37. package/resource/knowledge/callkit/core-sdk/android/make-call.md +5 -7
  38. package/resource/knowledge/callkit/core-sdk/android/offline-push.md +3 -5
  39. package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +2 -6
  40. package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +2 -6
  41. package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +4 -9
  42. package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1 -4
  43. package/resource/knowledge/callkit/core-sdk/ios/make-call.md +8 -11
  44. package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +17 -23
  45. package/resource/knowledge/callkit/core-sdk/web/call-engine.md +33 -0
  46. package/resource/knowledge/callkit/core-sdk/web/call-event.md +327 -0
  47. package/resource/knowledge/callkit/core-sdk/web/callengine-api-overview.md +33 -0
  48. package/resource/knowledge/callkit/faq/android.md +0 -2
  49. package/resource/knowledge/callkit/faq/error-code.md +0 -2
  50. package/resource/knowledge/callkit/faq/flutter.md +2 -2
  51. package/resource/knowledge/callkit/faq/ios.md +3 -5
  52. package/resource/knowledge/callkit/faq/web.md +2 -3
  53. package/resource/knowledge/callkit/preset/android/api.md +2 -5
  54. package/resource/knowledge/callkit/preset/ios/api.md +0 -2
  55. package/resource/knowledge/callkit/preset/react/api.md +445 -0
  56. package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +445 -0
  57. package/resource/knowledge/callkit/preset/vue/api.md +465 -0
  58. package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +465 -0
  59. package/resource/knowledge/chat/best-practice/web/image-message-url-handling.md +16 -0
  60. package/resource/knowledge/chat/preset/android/features/chat-setting.md +1 -1
  61. package/resource/knowledge/chat/preset/android/features/conversation-list.md +1 -1
  62. package/resource/knowledge/chat/preset/android/features/language.md +0 -1
  63. package/resource/knowledge/chat/preset/android/features/message-input.md +1 -1
  64. package/resource/knowledge/chat/preset/android/features/message-list.md +2 -3
  65. package/resource/knowledge/chat/preset/android/features/search.md +0 -1
  66. package/resource/knowledge/chat/preset/android/features/theme.md +1 -1
  67. package/resource/knowledge/chat/preset/android-view/integration.md +3 -11
  68. package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +0 -1
  69. package/resource/knowledge/chat/preset/flutter/features/message-list.md +1 -2
  70. package/resource/knowledge/chat/preset/flutter/features/search.md +5 -6
  71. package/resource/knowledge/chat/preset/flutter/features/theme.md +2 -2
  72. package/resource/knowledge/chat/preset/ios/features/chat-setting.md +1 -1
  73. package/resource/knowledge/chat/preset/ios/features/conversation-list.md +1 -2
  74. package/resource/knowledge/chat/preset/ios/features/message-list.md +1 -2
  75. package/resource/knowledge/chat/preset/ios/features/search.md +0 -1
  76. package/resource/knowledge/chat/preset/ios-uikit/integration.md +13 -15
  77. package/resource/knowledge/chat/preset/react/features/conversation-list.md +5 -5
  78. package/resource/knowledge/chat/preset/react/features/message-input.md +2 -3
  79. package/resource/knowledge/chat/preset/react/features/search.md +0 -1
  80. package/resource/knowledge/chat/preset/react/features/theme.md +0 -1
  81. package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +7 -14
  82. package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +5 -8
  83. package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +15 -18
  84. package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +1 -2
  85. package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +15 -20
  86. package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +10 -13
  87. package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +2 -4
  88. package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +4 -6
  89. package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +2 -4
  90. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +2 -4
  91. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +1 -2
  92. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +8 -10
  93. package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +5 -7
  94. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +7 -14
  95. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +6 -9
  96. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +1 -2
  97. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +15 -18
  98. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +15 -20
  99. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +10 -13
  100. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +2 -4
  101. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +4 -6
  102. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +2 -4
  103. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +2 -4
  104. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +1 -2
  105. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +8 -10
  106. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +3 -5
  107. package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +7 -14
  108. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +5 -8
  109. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +1 -2
  110. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +6 -9
  111. package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +5 -10
  112. package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +3 -6
  113. package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +2 -4
  114. package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +4 -6
  115. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +2 -4
  116. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +2 -4
  117. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +1 -2
  118. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +4 -6
  119. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +3 -5
  120. package/resource/knowledge/livekit/core-sdk/api-reference/{web → vue}/index.md +24 -24
  121. package/resource/knowledge/livekit/core-sdk/{voice/android/voice-audio-effect.md → features/android/audio-effect.md} +1 -2
  122. package/resource/knowledge/livekit/core-sdk/{live/android/live-gift.md → features/android/gift.md} +2 -3
  123. package/resource/knowledge/livekit/core-sdk/{voice/android/voice-room-list.md → features/android/live-list.md} +2 -4
  124. package/resource/knowledge/livekit/core-sdk/{live/flutter/live-audio-effect.md → features/flutter/audio-effect.md} +0 -2
  125. package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-barrage.md → features/flutter/barrage.md} +2 -2
  126. package/resource/knowledge/livekit/core-sdk/{live/flutter/live-gift.md → features/flutter/gift.md} +2 -3
  127. package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-room-list.md → features/flutter/live-list.md} +1 -1
  128. package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-audience-list.md → features/ios/audience-list.md} +1 -2
  129. package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-audio-effect.md → features/ios/audio-effect.md} +1 -3
  130. package/resource/knowledge/livekit/core-sdk/{live/ios/live-base-beauty.md → features/ios/base-beauty.md} +2 -2
  131. package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-gift.md → features/ios/gift.md} +2 -3
  132. package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-room-list.md → features/ios/live-list.md} +2 -4
  133. package/resource/knowledge/livekit/core-sdk/live/android/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -1
  134. package/resource/knowledge/livekit/core-sdk/live/android/{live-host-interaction.md → host-interaction.md} +5 -7
  135. package/resource/knowledge/livekit/core-sdk/live/android/{live-integration.md → integration.md} +3 -6
  136. package/resource/knowledge/livekit/core-sdk/live/flutter/{live-co-guest-interaction.md → co-guest-interaction.md} +1 -1
  137. package/resource/knowledge/livekit/core-sdk/live/flutter/{live-host-interaction.md → host-interaction.md} +0 -2
  138. package/resource/knowledge/livekit/core-sdk/live/flutter/{live-integration.md → integration.md} +1 -4
  139. package/resource/knowledge/livekit/core-sdk/live/ios/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -1
  140. package/resource/knowledge/livekit/core-sdk/live/ios/{live-host-interaction.md → host-interaction.md} +2 -4
  141. package/resource/knowledge/livekit/core-sdk/live/ios/{live-integration.md → integration.md} +2 -5
  142. package/resource/knowledge/livekit/core-sdk/voice/android/{voice-host-interaction.md → host-interaction.md} +3 -5
  143. package/resource/knowledge/livekit/core-sdk/voice/android/{voice-integration.md → integration.md} +3 -6
  144. package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-co-guest-interaction.md → co-guest-interaction.md} +1 -2
  145. package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-integration.md → integration.md} +6 -9
  146. package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-co-guest-interaction.md → co-guest-interaction.md} +2 -2
  147. package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-host-interaction.md → host-interaction.md} +4 -6
  148. package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-integration.md → integration.md} +1 -4
  149. package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +0 -2
  150. package/resource/knowledge/push/api-reference/android.md +123 -0
  151. package/resource/knowledge/push/api-reference/flutter.md +176 -0
  152. package/resource/knowledge/push/api-reference/harmonyos.md +138 -0
  153. package/resource/knowledge/push/api-reference/ios.md +176 -0
  154. package/resource/knowledge/push/api-reference/react-native.md +147 -0
  155. package/resource/knowledge/push/api-reference/uni-app.md +147 -0
  156. package/resource/knowledge/push/api-reference/unity.md +119 -0
  157. package/resource/knowledge/push/api-reference/unreal-engine.md +123 -0
  158. package/resource/knowledge/push/config/android.md +4 -7
  159. package/resource/knowledge/push/config/harmonyos.md +0 -3
  160. package/resource/knowledge/push/config/ios.md +12 -20
  161. package/resource/knowledge/push/config/react-native.md +18 -26
  162. package/resource/knowledge/push/config/unity.md +20 -28
  163. package/resource/knowledge/push/config/unreal-engine.md +21 -29
  164. package/resource/knowledge/push/integration/android.md +6 -8
  165. package/resource/knowledge/push/integration/flutter.md +6 -9
  166. package/resource/knowledge/push/integration/harmonyos.md +1 -0
  167. package/resource/knowledge/push/integration/ios.md +7 -9
  168. package/resource/knowledge/push/integration/react-native.md +9 -13
  169. package/resource/knowledge/push/integration/uni-app.md +7 -7
  170. package/resource/knowledge/push/integration/unity.md +10 -13
  171. package/resource/knowledge/push/integration/unreal-engine.md +6 -9
  172. package/resource/knowledge/push/overview/prepare.md +2 -2
  173. package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +3 -3
  174. package/resource/knowledge/roomkit/core-sdk/android/capability-matrix.md +46 -0
  175. package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +1 -1
  176. package/resource/knowledge/roomkit/core-sdk/android/room-state.md +2 -2
  177. package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +6 -6
  178. package/resource/knowledge/roomkit/core-sdk/android/unsupported-features.md +79 -0
  179. package/resource/knowledge/roomkit/core-sdk/flutter/capability-matrix.md +46 -0
  180. package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +1 -1
  181. package/resource/knowledge/roomkit/core-sdk/flutter/unsupported-features.md +79 -0
  182. package/resource/knowledge/roomkit/core-sdk/ios/capability-matrix.md +46 -0
  183. package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +1 -1
  184. package/resource/knowledge/roomkit/core-sdk/ios/unsupported-features.md +79 -0
  185. package/resource/knowledge/roomkit/preset/android/integration.md +5 -7
  186. package/resource/knowledge/roomkit/preset/flutter/integration.md +2 -7
  187. package/resource/knowledge/roomkit/preset/ios/integration.md +3 -9
  188. package/resource/knowledge/roomkit/preset/react/integration.md +12 -16
  189. package/resource/knowledge/trtc/android/TRTCCloud.md +154 -238
  190. package/resource/knowledge/trtc/android/TRTCCloudDef.md +133 -134
  191. package/resource/knowledge/trtc/android/TRTCCloudListener.md +86 -120
  192. package/resource/knowledge/trtc/android/TRTCStatistics.md +10 -10
  193. package/resource/knowledge/trtc/android/TXAudioEffectManager.md +10 -30
  194. package/resource/knowledge/trtc/android/TXBeautyManager.md +25 -25
  195. package/resource/knowledge/trtc/android/TXDeviceManager.md +2 -2
  196. package/resource/knowledge/trtc/android/TXLiteAVCode.md +12 -12
  197. package/resource/knowledge/trtc/c++/ITRTCCloud.md +166 -261
  198. package/resource/knowledge/trtc/c++/ITRTCStatistics.md +12 -12
  199. package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +10 -30
  200. package/resource/knowledge/trtc/c++/ITXDeviceManager.md +9 -11
  201. package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +96 -130
  202. package/resource/knowledge/trtc/c++/TRTCTypeDef.md +122 -123
  203. package/resource/knowledge/trtc/c++/TXLiteAVCode.md +12 -12
  204. package/resource/knowledge/trtc/ios/TRTCCloud.md +168 -255
  205. package/resource/knowledge/trtc/ios/TRTCCloudDef.md +124 -125
  206. package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +89 -124
  207. package/resource/knowledge/trtc/ios/TRTCStatistics.md +10 -10
  208. package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +9 -28
  209. package/resource/knowledge/trtc/ios/TXBeautyManager.md +25 -25
  210. package/resource/knowledge/trtc/ios/TXDeviceManager.md +9 -11
  211. package/resource/knowledge/trtc/ios/TXLiteAVCode.md +12 -12
  212. package/server-config.js +7 -4
  213. package/server.js +21 -21
  214. package/tools/common/finalize_answer.js +1 -1
  215. package/tools/common/present_framework_choice.js +2 -2
  216. package/tools/common/search_trtc_knowledge.js +3 -3
  217. package/tools/common/submit_feedback.js +1 -1
  218. package/tools/definitions/get_native_live_uikit_integration_def.js +61 -0
  219. package/tools/definitions/get_native_livekit_core_integration_def.js +3 -3
  220. package/tools/definitions/present_framework_choice_def.js +2 -2
  221. package/tools/definitions/search_trtc_knowledge_def.js +5 -5
  222. package/tools/index.js +2 -0
  223. package/tools/live/get_native_live_uikit_integration.js +69 -0
  224. package/tools/live/get_native_livekit_core_integration.js +6 -6
  225. package/utils/is-valid-sdkappid.js +4 -0
  226. package/utils/report-cls-client.js +1 -1
  227. package/utils/report-es-client.js +1 -1
  228. package/resource/knowledge/callkit/preset/web/api.md +0 -83
  229. package/resource/knowledge/livekit/core-sdk/live/android/live-audio-effect.md +0 -226
  230. package/resource/knowledge/livekit/core-sdk/live/android/live-live-list.md +0 -438
  231. package/resource/knowledge/livekit/core-sdk/live/flutter/live-barrage.md +0 -490
  232. package/resource/knowledge/livekit/core-sdk/live/flutter/live-live-list.md +0 -726
  233. package/resource/knowledge/livekit/core-sdk/live/ios/live-audience-list.md +0 -264
  234. package/resource/knowledge/livekit/core-sdk/live/ios/live-audio-effect.md +0 -216
  235. package/resource/knowledge/livekit/core-sdk/live/ios/live-gift.md +0 -407
  236. package/resource/knowledge/livekit/core-sdk/live/ios/live-live-list.md +0 -349
  237. package/resource/knowledge/livekit/core-sdk/voice/android/voice-audience-list.md +0 -269
  238. package/resource/knowledge/livekit/core-sdk/voice/android/voice-barrage.md +0 -456
  239. package/resource/knowledge/livekit/core-sdk/voice/android/voice-gift.md +0 -455
  240. package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audience-list.md +0 -260
  241. package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audio-effect.md +0 -598
  242. package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-gift.md +0 -424
  243. package/resource/knowledge/livekit/core-sdk/voice/ios/voice-barrage.md +0 -408
  244. /package/resource/knowledge/livekit/core-sdk/{live/android/live-audience-list.md → features/android/audience-list.md} +0 -0
  245. /package/resource/knowledge/livekit/core-sdk/{live/android/live-barrage.md → features/android/barrage.md} +0 -0
  246. /package/resource/knowledge/livekit/core-sdk/{live/android/live-base-beauty.md → features/android/base-beauty.md} +0 -0
  247. /package/resource/knowledge/livekit/core-sdk/{live/flutter/live-audience-list.md → features/flutter/audience-list.md} +0 -0
  248. /package/resource/knowledge/livekit/core-sdk/{live/flutter/live-base-beauty.md → features/flutter/base-beauty.md} +0 -0
  249. /package/resource/knowledge/livekit/core-sdk/{live/ios/live-barrage.md → features/ios/barrage.md} +0 -0
  250. /package/resource/knowledge/livekit/core-sdk/voice/android/{voice-co-guest-interaction.md → co-guest-interaction.md} +0 -0
@@ -1,424 +0,0 @@
1
- `GiftStore` is a module in `AtomicXCore` specialized in managing the gift function of live streaming rooms. With it, you can build a complete gift system for your live stream application to achieve various revenue and interactive scenarios.
2
-
3
- |**Gift Panel**|**Barrage Gift**|**Full-Screen Gift**|
4
- |---------|---------|---------|
5
- ||||
6
-
7
- ## Core Features
8
- - **Gift List Retrieval**: Obtain the required data for the gift panel from the server, including gift categories and gift details.
9
-
10
- - **Send a Gift**: The audience can send a selected gift to the Anchor with quantity.
11
-
12
- - **Gift Event Broadcast**: Receive gift giveaway events inside the room in real time for showing gift animation and bullet screen notification.
13
-
14
- ## Core Concepts
15
-
16
- Before starting integration, let's learn about several core concepts related to `GiftStore` in the following table:
17
-
18
- |**Core Concepts**|**Type**|**Core Responsibilities and Description**|
19
- |---------|---------|---------|
20
- |[Gift](https://tencent-rtc.github.io/TUIKit_Flutter/api_gift_gift_store/Gift-class.html)|`class`|Represents a specific gift data model. It contains the gift ID, name, icon address, animation resource URL and price (coins).|
21
- |[GiftCategory](https://tencent-rtc.github.io/TUIKit_Flutter/api_gift_gift_store/GiftCategory-class.html)|`class`|Represents a gift category, such as "popular" and "luxury". It contains the category name as well as the **Gift** list under this category.|
22
- |[GiftState](https://tencent-rtc.github.io/TUIKit_Flutter/api_gift_gift_store/GiftState-class.html)|`class`|Represents the current status of the gift module. Its core attribute `usableGifts` is a `ValueListenable<List<GiftCategory>>`, storing the complete gift list fetched from the server.|
23
- |[GiftListener](https://tencent-rtc.github.io/TUIKit_Flutter/api_gift_gift_store/GiftListener-class.html)|`class`|Gift event listener, receive gift giveaway event through the `onReceiveGift` callback. When anyone (including itself) sends a gift, all people in the room will receive this event.|
24
- |[GiftStore](https://tencent-rtc.github.io/TUIKit_Flutter/api_gift_gift_store/GiftStore-class.html)|`class`|This is the core management class for interacting with the gift function. Through it, you can fetch the gift list, send a gift, and receive gift events via `addGiftListener`.|
25
-
26
- ## Implementation Steps
27
-
28
- ### Step 1: Integrate the Component
29
-
30
- > **Note:**
31
- >
32
-
33
- > To use the gifting system, activate either the **Free Trial,** or **Pro **edition. The number of configurable gifts depends on the selected package. For details, see the **Gift System** section in Feature and Billing Description and choose the package that fits your needs.
34
- >
35
-
36
- - **Live streaming**: Refer to Quick Integration for seamless integration with **AtomicXCore**.
37
-
38
- - **Voice chat room**: Refer to Quick Integration for seamless integration with **AtomicXCore**.
39
-
40
- ### Step 2: Initialize and Listen for Gift Events
41
-
42
- Get the `GiftStore` instance and set a listener for receiving gifts and list update events.
43
- 1. **Get instance**: Use `GiftStore.create(liveId)` to get the `GiftStore` instance bound to the current live streaming room.
44
-
45
- 2. **Subscribe to events**: Add a gift event listener via `giftStore.addGiftListener(listener)`.
46
-
47
- 3. **Subscription status**: Listen to `giftStore.giftState.usableGifts` to get gift list updates.
48
-
49
- #### Sample code:
50
- ``` java
51
- import 'package:flutter/foundation.dart';
52
- import 'package:atomic_x_core/atomicxcore.dart';
53
-
54
- class GiftManager {
55
- final String liveId;
56
- late final GiftStore giftStore;
57
- late final GiftListener _giftListener;
58
- late final VoidCallback _giftListChangedListener = _onGiftListChanged;
59
-
60
- // Expose gift event callback externally
61
- void Function(String liveID, Gift gift, int count, LiveUserInfo sender)? onReceiveGift;
62
-
63
- // Expose the gift list externally
64
- ValueNotifier<List<GiftCategory>> giftListNotifier = ValueNotifier([]);
65
-
66
- GiftManager({required this.liveId}) {
67
- // 1. Get the instance of GiftStore by liveId
68
- giftStore = GiftStore.create(liveId);
69
-
70
- _subscribeToGiftState();
71
- _subscribeToGiftEvents();
72
- }
73
-
74
- /// 2. Subscribe to gift events
75
- void _subscribeToGiftEvents() {
76
- _giftListener = GiftListener(
77
- onReceiveGift: (liveID, gift, count, sender) {
78
- // After receiving the event, forward it to external processing
79
- onReceiveGift?.call(liveID, gift, count, sender);
80
- },
81
- );
82
- giftStore.addGiftListener(_giftListener);
83
- }
84
-
85
- /// 3. Subscribe to gift list status
86
- void _subscribeToGiftState() {
87
- giftStore.giftState.usableGifts.addListener(_giftListChangedListener);
88
- }
89
-
90
- void _onGiftListChanged() {
91
- giftListNotifier.value = giftStore.giftState.usableGifts.value;
92
- }
93
-
94
- // Call the dispose method to reclaim resources when exiting the live streaming room
95
- void dispose() {
96
- giftStore.removeGiftListener(_giftListener);
97
- giftStore.giftState.usableGifts.removeListener(_giftListChangedListener);
98
- giftListNotifier.dispose();
99
- }
100
- }
101
- ```
102
-
103
- #### Gift List Structure Parameter
104
- - `GiftCategory`**Parameters**
105
-
106
- |**Parameter**|**Type**|**Description**|
107
- |---------|---------|---------|
108
- |`categoryID`|`String`|Unique ID of the gift category.|
109
- |`name`|`String`|Display name of the gift category.|
110
- |`desc`|`String`|Description of the gift category.|
111
- |`extensionInfo`|`Map<String, String>`|Extended information field.|
112
- |`giftList`|`List<Gift>`|Array of Gift objects under this category.|
113
-
114
- - `Gift`**Parameters**
115
-
116
- |**Parameter**|**Type**|**Description**|
117
- |---------|---------|---------|
118
- |`giftID`|`String`|Unique ID of the gift.|
119
- |`name`|`String`|Display name of the gift.|
120
- |`desc`|`String`|Description of the gift.|
121
- |`iconURL`|`String`|Icon URL of the gift.|
122
- |`resourceURL`|`String`|Resource URL of the gift animation.|
123
- |`level`|`int`|Gift level.|
124
- |`coins`|`int`|Gift price.|
125
- |`extensionInfo`|`Map<String, String>`|Extended information.|
126
-
127
- ### Step 3: Obtain the Gift List
128
-
129
- Call the `refreshUsableGifts` method to fetch gift data from the server.
130
- 1. **API call**: Call `giftStore.refreshUsableGifts()` at the appropriate timing (such as after entering the live room).
131
-
132
- 2. **Processing result**: Optionally process the returned results to fetch the pull results.
133
-
134
- 3. **Receive Data**: After the update, the gift list is automatically received by listening to `giftStore.giftState.usableGifts` in Step 2.
135
-
136
- #### Sample code:
137
- ``` java
138
- extension GiftManagerFetch on GiftManager {
139
- /// Refresh the gift list from the server
140
- Future<void> fetchGiftList() async {
141
- final result = await giftStore.refreshUsableGifts();
142
- if (result.isSuccess) {
143
- debugPrint("Gift list success message");
144
- // Upon success, the data is auto-updated via usableGifts listen
145
- } else {
146
- debugPrint("Gift list failed to pull: ${result.errorMessage}");
147
- }
148
- }
149
- }
150
- ```
151
-
152
- ### Step 4: Send a Gift
153
-
154
- When a user selects a gift in the gift panel and clicks send, call the `sendGift` API to send the gift.
155
- 1. **Get parameter**: Obtain the `giftID` selected by the user and the number of messages sent (`count`) from the UI.
156
-
157
- 2. **API call**: Call `giftStore.sendGift(giftID:, count:)`.
158
-
159
- 3. **Handle result**: Handle failure cases (such as insufficient account balance notification) in the returned result. UI updates (animation, bullet screen) after successful sending should be event-driven by `onReceiveGift`.
160
-
161
- #### Sample code:
162
- ``` java
163
- extension GiftManagerSend on GiftManager {
164
- /// User sends a gift
165
- Future<void> sendGift(String giftID, int count) async {
166
- final result = await giftStore.sendGift(giftID: giftID, count: count);
167
- if (result.isSuccess) {
168
- debugPrint("Gift $giftID sent successfully");
169
- // After the message is sent successfully, everyone including the sender will receive the onReceiveGift event
170
- } else {
171
- debugPrint("Gift sending failed: ${result.errorMessage}");
172
- // You can prompt user here, such as "Insufficient balance" or "Network error"
173
- }
174
- }
175
- }
176
- ```
177
-
178
- #### `SendGift` API Parameters
179
-
180
- |**Parameter Name**|**Type**|**Description**|
181
- |---------|---------|---------|
182
- |`giftID`|`String`|Unique ID of the gift to send.|
183
- |`count`|`int`|The number of sent.|
184
-
185
- ## Advanced Usage
186
-
187
- `GiftStore` feature heavily depends on your business backend service. This chapter will guide you on how to build a feature-rich, outstanding experience interactive system through server configuration and client implementation.
188
-
189
- ### **Gift **Asset Configuration
190
-
191
- Customize your live room's available gifts, categories, names, icons, prices, and animation effects to fit your operational and branding needs.
192
- 1. **Server-Side Configuration**: Use the LiveKit server REST API to manage gift information, categories, and multi-language support. See the Gift Configuration Guide.
193
-
194
- 2. **Client Fetch**: On the client, call `refreshUsableGifts` to retrieve configuration data.
195
-
196
- 3. **UI Display**: Use the retrieved `List<GiftCategory>` to render the gift panel.
197
-
198
- #### Configuration Sequence Diagram
199
-
200
- #### Related REST API Interfaces Overview
201
- | <strong>Interface Category</strong> | <strong>Interface</strong> | <strong>Request Example</strong> |
202
- | --- | --- | --- |
203
- | <strong>​Gift Management</strong> | Add Gift Information. | Example |
204
- | Delete Gift Information. | Example | |
205
- | Query Gift Information. | Example | |
206
- | <strong>Gift Category Management</strong> | Add Gift Category Information. | Example |
207
- | Delete Specific Gift Category Information. | Example | |
208
- | Get Specific Gift Category Information. | Example | |
209
- | <strong>Gift Relationship Management</strong> | Add Relationship between a Specific Gift Category and Gift. | Example |
210
- | Delete Relationship between a Specific Gift Category and Gift. | Example | |
211
- | Get Gift Relationships under a Specific Gift Category. | Example | |
212
- | <strong>Gift Multi-language Management</strong> | Add Gift Multi-language Information. | Example |
213
- | Delete Specific Gift Multi-language Information. | Example | |
214
- | Get Gift Multi-language Information. | Example | |
215
- | Add Gift Category Multi-language Information. | Example | |
216
- | Delete Specific Gift Category Multi-language Information. | Example | |
217
- | Get Gift Category Multi-language Information. | Example | |
218
-
219
- ### Billing and Gift Deduction Workflow
220
-
221
- When the audience sends gifts, ensure sufficient account balance and complete the actual deduction before triggering the gift effect playback and broadcast.
222
-
223
- #### Workflow
224
- 1. **Configure Backend Webhook**: Configure your billing system's callback URL in the LiveKit backend. See Callback Configuration Documentation.
225
-
226
- 2. **Client Request**: The client calls `sendGift`.
227
-
228
- 3. **Backend Verification**: The LiveKit backend calls your callback URL; your billing system processes the deduction and returns the result.
229
-
230
- 4. **Result Synchronization**: If succeeds, **AtomicXCore** broadcasts the `onReceiveGift` event; if fails, the completion callback of `sendGift` receives an error.
231
-
232
- #### Call Flow
233
-
234
- #### REST API Overview
235
-
236
- |**Interface**|**Description**|**Request Example**|
237
- |---------|---------|---------|
238
- |**Webhook Configuration - Pre-send Gift Webhook**|Allows your backend to validate and approve gift sending (e.g., pre-send checks).|Example|
239
-
240
- ### Play Full-Screen Gift Animations
241
-
242
- When a user sends a "Rocket", "Carnival", or other luxury gift, display a full-screen animation (e.g., SVGA) to boost engagement.
243
-
244
- #### Implementation Steps
245
-
246
- `AtomicXCore` itself does not include a gift animation player. You need to select and integrate a third-party library based on business requirements. The following is a comparison of two solutions:
247
-
248
- |**Comparison Item**|**Basic Solution (Svgaplayer_flutter)**|**Advanced Plan (TCEffectPlayerKit)**|
249
- |---------|---------|---------|
250
- |Billing|Free (open-source library)|Paid (License purchase required), please see [Payment Guide](https://trtc.io/document/69949)|
251
- |Integration Method|Manual integration of the [svgaplayer_flutter](https://pub.dev/packages/svgaplayer_flutter) library is required.|Additional integration of the [flutter_effect_player](https://github.com/Tencent-RTC/EffectPlayer_Flutter) library and authentication are required.|
252
- |Animation Format Support|SVGA only|SVGA, PAG, WebP, Lottie, MP4, and other formats|
253
- |Performance|Recommend SVGA files ≤ 10MB|Support larger animation files, better performance for complex effects, multi-animation concurrency, and low-end devices|
254
- |Recommended scenarios|Gift animation format is unified as SVGA with controllable file size|Support multiple animation formats or higher performance/compatibility requirements|
255
-
256
- This section demonstrates the basic solution. If you select the advanced plan, refer to [EffectPlayer Flutter integration guide](https://trtc.io/document/73975).
257
-
258
- #### Basic Solution: Use Svgaplayer_flutter
259
- 1. **Integrate svgaplayer_flutter**: In your `pubspec.yaml` file, add dependency and run `flutter pub get`.
260
-
261
- ``` yaml
262
- dependencies:
263
- svgaplayer_flutter: ^2.0.0
264
- ```
265
- 2. **Listen for gift events**: Add a listener via `GiftStore`'s `addGiftListener`.
266
-
267
- 3. **Parse and play animation**: When the `onReceiveGift` event is received, check if `gift.resourceURL` is valid and points to an SVGA file. If so, use `SVGAAnimationController` to play the animation.
268
-
269
- #### Sample Code:
270
- ``` java
271
- import 'package:flutter/material.dart';
272
- import 'package:atomic_x_core/atomicxcore.dart';
273
- import 'package:svgaplayer_flutter/svgaplayer_flutter.dart';
274
-
275
- class LiveRoomWidget extends StatefulWidget {
276
- final String liveId;
277
- const LiveRoomWidget({Key? key, required this.liveId}) : super(key: key);
278
-
279
- @override
280
- State<LiveRoomWidget> createState() => _LiveRoomWidgetState();
281
- }
282
-
283
- class _LiveRoomWidgetState extends State<LiveRoomWidget> with SingleTickerProviderStateMixin {
284
- late GiftManager giftManager;
285
-
286
- // SVGA player
287
- late SVGAAnimationController _svgaController;
288
- bool _showAnimation = false;
289
-
290
- @override
291
- void initState() {
292
- super.initState();
293
- _svgaController = SVGAAnimationController(vsync: this);
294
- _setupGiftSubscription();
295
- }
296
-
297
- void _setupGiftSubscription() {
298
- giftManager = GiftManager(liveId: widget.liveId);
299
-
300
- giftManager.onReceiveGift = (liveID, gift, count, sender) {
301
- if (gift.resourceURL.isNotEmpty) {
302
- _playAnimation(gift.resourceURL);
303
- }
304
- };
305
- }
306
-
307
- Future<void> _playAnimation(String url) async {
308
- try {
309
- final videoItem = await SVGAParser.shared.decodeFromURL(url);
310
- _svgaController.videoItem = videoItem;
311
- setState(() {
312
- _showAnimation = true;
313
- });
314
- _svgaController.forward().whenComplete(() {
315
- setState(() {
316
- _showAnimation = false;
317
- });
318
- });
319
- } catch (e) {
320
- debugPrint("SVGA animation parsing failure: $e");
321
- }
322
- }
323
-
324
- @override
325
- void dispose() {
326
- _svgaController.dispose();
327
- giftManager.dispose();
328
- super.dispose();
329
- }
330
-
331
- @override
332
- Widget build(BuildContext context) {
333
- return Stack(
334
- children: [
335
- // Live stream
336
- // ...
337
-
338
- // Full-Screen Gift Animation
339
- if (_showAnimation)
340
- Positioned.fill(
341
- child: SVGAImage(_svgaController),
342
- ),
343
- ],
344
- );
345
- }
346
- }
347
- ```
348
-
349
- #### Display Gift Messages in Barrage Area
350
-
351
- When a user sends a gift, it not only plays the animation but also displays a system message in the on-screen comment area, such as "[Nickname] sent [gift name] x [quantity]", so all audience can see.
352
-
353
- #### Implementation Steps
354
- 1. **Listen for events**: Add a listener via `giftStore.addGiftListener`.
355
-
356
- 2. **Obtain information**: After the `onReceiveGift` event is received, extract the sender, gift, and count.
357
-
358
- 3. **Retrieve the bullet screen Store**: Use `BarrageStore.create(liveId)` to get the instance bound to the current room.
359
-
360
- 4. **Concatenate messages**: Create a `Barrage` object, set `messageType = BarrageType.text`, and `textContent` as the concatenated string (such as "[`sender.userName`] sent [`gift.name`] x [`count`]").
361
-
362
- 5. **Local insertion**: Call `barrageStore.appendLocalTip(giftTip)` to insert the message into the local list.
363
-
364
- #### Sample Code:
365
- ``` java
366
- // In LiveRoomManager or similar top-level managers
367
- void _setupGiftToBarrageFlow() {
368
- final giftStore = GiftStore.create(liveId);
369
- final barrageStore = BarrageStore.create(liveId);
370
-
371
- final giftListener = GiftListener(
372
- onReceiveGift: (liveID, gift, count, sender) {
373
- // Concatenate the message
374
- final tipText = "${sender.userName} sent ${gift.name} x $count";
375
- final giftTip = Barrage(
376
- messageType: BarrageType.text,
377
- textContent: tipText,
378
- );
379
- // Optional: Set a special sender
380
-
381
- // local insertion
382
- barrageStore.appendLocalTip(giftTip);
383
- },
384
- );
385
-
386
- giftStore.addGiftListener(giftListener);
387
- }
388
- ```
389
-
390
- ## API documentation
391
-
392
- For detailed information about all public interfaces, attributes, and methods of [GiftStore](https://tencent-rtc.github.io/TUIKit_Flutter/api_gift_gift_store/GiftStore-class.html) and its related classes, see the official API documentation of the [AtomicXCore](https://tencent-rtc.github.io/TUIKit_Flutter/index.html) framework. The related Stores used in this guide are as follows:
393
-
394
- |**Store/Component**|**Feature Description**|**API Reference**|
395
- |---------|---------|---------|
396
- |**GiftStore**|Gift interaction: Get gift list, send/receive gifts, listen to gift events (including sender, gift details).|[API documentation](https://tencent-rtc.github.io/TUIKit_Flutter/api_gift_gift_store/GiftStore-class.html)|
397
- |**BarrageStore**|Danmaku function: send text / custom barrage item, maintain bullet screen list, monitor in real time.|[API documentation](https://tencent-rtc.github.io/TUIKit_Flutter/api_barrage_barrage_store/BarrageStore-class.html)|
398
-
399
- ## FAQs
400
-
401
- ### Why is the gift list in GiftStore empty?
402
-
403
- You must actively call `refreshUsableGifts()` to fetch gift data from your backend. These gift data need to be configured in your backend via server-side REST API.
404
-
405
- ### How do I show gifts in multiple languages (e.g., Chinese, English)?
406
-
407
- `GiftStore` provides the `setLanguage(String language)` API. You can call this method before `refreshUsableGifts`, input the target language code (such as "en" or "zh-CN"). The server will return the gift name and description in the corresponding language based on this language code.
408
-
409
- ### Why does the gift animation play twice after sending a gift?
410
-
411
- `onReceiveGift` is a broadcast to all members in the room (including the sender). If you perform a UI operation in the success callback of `sendGift`, and simultaneously execute the same UI operation in the `onReceiveGift` callback, it can lead to duplication.
412
- - **Best practice**: UI updates (such as playing animation, bullet screen notification) should only be handled in the callback of the `onReceiveGift` event. The returned results of `sendGift` are only used to process the logic of sending failure (such as prompting the user "sending failure" or "insufficient balance").
413
-
414
- ### Where is the gift deduction logic handled?
415
-
416
- The gift charge logic is fully handled by your self-built billing system. `AtomicXCore` connects with your billing system through a backend callback mechanism. The client calls `sendGift` to trigger the callback. After your backend service completes the charge, it returns the result to the `AtomicXCore` backend, thereby determining whether to broadcast the gift event.
417
-
418
- ### Are gift notifications affected by mute or message rate limiting?
419
-
420
- No. Gift sending notifications (`onReceiveGift` event) are not affected by muting or message frequency control, ensuring reliable delivery.
421
-
422
- ### What if gift animation playback is laggy?
423
-
424
- Please check your SVGA file size. Player SDKs recommend not exceeding 10MB. If the file is too large or the animation is complex, you can consider seamless integration with the advanced effect player provided by TUILiveKit to get better performance.