@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.
- package/index.js +0 -4
- package/knowledge/chunker.js +83 -54
- package/knowledge/path-meta.js +179 -26
- package/knowledge/search/exact-lookup.js +153 -0
- package/knowledge/search/filter-pool.js +73 -19
- package/knowledge/search/product-scope-intent.js +2 -2
- package/knowledge/search/requires-framework.js +2 -2
- package/knowledge/search/search-knowledge.js +235 -58
- package/package.json +1 -1
- package/resource/index/manifest.json +1 -1
- package/resource/integration/callkit/preset/android/integration.md +2 -4
- package/resource/integration/callkit/preset/flutter/integration.md +4 -5
- package/resource/integration/callkit/preset/ios/integration.md +1 -4
- package/resource/integration/callkit/preset/react/integration.md +13 -20
- package/resource/integration/callkit/preset/vue/integration.md +14 -21
- package/resource/integration/chat/preset/android/integration.md +6 -9
- package/resource/integration/chat/preset/flutter/integration.md +9 -12
- package/resource/integration/chat/preset/ios/integration.md +2 -4
- package/resource/integration/chat/preset/react/integration.md +0 -10
- package/resource/integration/livekit/preset/live/android/live-audience-integration.md +129 -0
- package/resource/integration/livekit/preset/live/android/live-host-integration.md +219 -0
- package/resource/integration/livekit/preset/live/android/live-list-integration.md +261 -0
- package/resource/integration/livekit/preset/live/android/prepare-integration.md +254 -0
- package/resource/integration/livekit/preset/live/ios/live-audience-integration.md +202 -0
- package/resource/integration/livekit/preset/live/ios/live-host-integration.md +369 -0
- package/resource/integration/livekit/preset/live/ios/live-list-integration.md +229 -0
- package/resource/integration/livekit/preset/live/ios/prepare-integration.md +204 -0
- package/resource/integration/livekit/preset/live/vue/live-list-integration.md +0 -3
- package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +0 -5
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +0 -6
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +5 -10
- package/resource/integration/roomkit/preset/vue/integration.md +0 -4
- package/resource/knowledge/callkit/best-practice/web/callengine-invitation.md +80 -0
- package/resource/knowledge/callkit/best-practice/web/callengine-log-control.md +24 -0
- package/resource/knowledge/callkit/best-practice/web/callkit-call-vs-calls.md +116 -0
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +7 -8
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +5 -7
- package/resource/knowledge/callkit/core-sdk/android/offline-push.md +3 -5
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +2 -6
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +2 -6
- package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +4 -9
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1 -4
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +8 -11
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +17 -23
- package/resource/knowledge/callkit/core-sdk/web/call-engine.md +33 -0
- package/resource/knowledge/callkit/core-sdk/web/call-event.md +327 -0
- package/resource/knowledge/callkit/core-sdk/web/callengine-api-overview.md +33 -0
- package/resource/knowledge/callkit/faq/android.md +0 -2
- package/resource/knowledge/callkit/faq/error-code.md +0 -2
- package/resource/knowledge/callkit/faq/flutter.md +2 -2
- package/resource/knowledge/callkit/faq/ios.md +3 -5
- package/resource/knowledge/callkit/faq/web.md +2 -3
- package/resource/knowledge/callkit/preset/android/api.md +2 -5
- package/resource/knowledge/callkit/preset/ios/api.md +0 -2
- package/resource/knowledge/callkit/preset/react/api.md +445 -0
- package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +445 -0
- package/resource/knowledge/callkit/preset/vue/api.md +465 -0
- package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +465 -0
- package/resource/knowledge/chat/best-practice/web/image-message-url-handling.md +16 -0
- package/resource/knowledge/chat/preset/android/features/chat-setting.md +1 -1
- package/resource/knowledge/chat/preset/android/features/conversation-list.md +1 -1
- package/resource/knowledge/chat/preset/android/features/language.md +0 -1
- package/resource/knowledge/chat/preset/android/features/message-input.md +1 -1
- package/resource/knowledge/chat/preset/android/features/message-list.md +2 -3
- package/resource/knowledge/chat/preset/android/features/search.md +0 -1
- package/resource/knowledge/chat/preset/android/features/theme.md +1 -1
- package/resource/knowledge/chat/preset/android-view/integration.md +3 -11
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +0 -1
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +1 -2
- package/resource/knowledge/chat/preset/flutter/features/search.md +5 -6
- package/resource/knowledge/chat/preset/flutter/features/theme.md +2 -2
- package/resource/knowledge/chat/preset/ios/features/chat-setting.md +1 -1
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +1 -2
- package/resource/knowledge/chat/preset/ios/features/message-list.md +1 -2
- package/resource/knowledge/chat/preset/ios/features/search.md +0 -1
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +13 -15
- package/resource/knowledge/chat/preset/react/features/conversation-list.md +5 -5
- package/resource/knowledge/chat/preset/react/features/message-input.md +2 -3
- package/resource/knowledge/chat/preset/react/features/search.md +0 -1
- package/resource/knowledge/chat/preset/react/features/theme.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +7 -14
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +5 -8
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +15 -18
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +15 -20
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +10 -13
- package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +8 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +5 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +7 -14
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +6 -9
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +15 -18
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +15 -20
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +10 -13
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +8 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +3 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +7 -14
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +5 -8
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +6 -9
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +5 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +3 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +3 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/{web → vue}/index.md +24 -24
- package/resource/knowledge/livekit/core-sdk/{voice/android/voice-audio-effect.md → features/android/audio-effect.md} +1 -2
- package/resource/knowledge/livekit/core-sdk/{live/android/live-gift.md → features/android/gift.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/{voice/android/voice-room-list.md → features/android/live-list.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/{live/flutter/live-audio-effect.md → features/flutter/audio-effect.md} +0 -2
- package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-barrage.md → features/flutter/barrage.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/{live/flutter/live-gift.md → features/flutter/gift.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-room-list.md → features/flutter/live-list.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-audience-list.md → features/ios/audience-list.md} +1 -2
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-audio-effect.md → features/ios/audio-effect.md} +1 -3
- package/resource/knowledge/livekit/core-sdk/{live/ios/live-base-beauty.md → features/ios/base-beauty.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-gift.md → features/ios/gift.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-room-list.md → features/ios/live-list.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/live/android/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -1
- package/resource/knowledge/livekit/core-sdk/live/android/{live-host-interaction.md → host-interaction.md} +5 -7
- package/resource/knowledge/livekit/core-sdk/live/android/{live-integration.md → integration.md} +3 -6
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-co-guest-interaction.md → co-guest-interaction.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-host-interaction.md → host-interaction.md} +0 -2
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-integration.md → integration.md} +1 -4
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -1
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-host-interaction.md → host-interaction.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-integration.md → integration.md} +2 -5
- package/resource/knowledge/livekit/core-sdk/voice/android/{voice-host-interaction.md → host-interaction.md} +3 -5
- package/resource/knowledge/livekit/core-sdk/voice/android/{voice-integration.md → integration.md} +3 -6
- package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-co-guest-interaction.md → co-guest-interaction.md} +1 -2
- package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-integration.md → integration.md} +6 -9
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-co-guest-interaction.md → co-guest-interaction.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-host-interaction.md → host-interaction.md} +4 -6
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-integration.md → integration.md} +1 -4
- package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +0 -2
- package/resource/knowledge/push/api-reference/android.md +123 -0
- package/resource/knowledge/push/api-reference/flutter.md +176 -0
- package/resource/knowledge/push/api-reference/harmonyos.md +138 -0
- package/resource/knowledge/push/api-reference/ios.md +176 -0
- package/resource/knowledge/push/api-reference/react-native.md +147 -0
- package/resource/knowledge/push/api-reference/uni-app.md +147 -0
- package/resource/knowledge/push/api-reference/unity.md +119 -0
- package/resource/knowledge/push/api-reference/unreal-engine.md +123 -0
- package/resource/knowledge/push/config/android.md +4 -7
- package/resource/knowledge/push/config/harmonyos.md +0 -3
- package/resource/knowledge/push/config/ios.md +12 -20
- package/resource/knowledge/push/config/react-native.md +18 -26
- package/resource/knowledge/push/config/unity.md +20 -28
- package/resource/knowledge/push/config/unreal-engine.md +21 -29
- package/resource/knowledge/push/integration/android.md +6 -8
- package/resource/knowledge/push/integration/flutter.md +6 -9
- package/resource/knowledge/push/integration/harmonyos.md +1 -0
- package/resource/knowledge/push/integration/ios.md +7 -9
- package/resource/knowledge/push/integration/react-native.md +9 -13
- package/resource/knowledge/push/integration/uni-app.md +7 -7
- package/resource/knowledge/push/integration/unity.md +10 -13
- package/resource/knowledge/push/integration/unreal-engine.md +6 -9
- package/resource/knowledge/push/overview/prepare.md +2 -2
- package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +3 -3
- package/resource/knowledge/roomkit/core-sdk/android/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +2 -2
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +6 -6
- package/resource/knowledge/roomkit/core-sdk/android/unsupported-features.md +79 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/flutter/unsupported-features.md +79 -0
- package/resource/knowledge/roomkit/core-sdk/ios/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/ios/unsupported-features.md +79 -0
- package/resource/knowledge/roomkit/preset/android/integration.md +5 -7
- package/resource/knowledge/roomkit/preset/flutter/integration.md +2 -7
- package/resource/knowledge/roomkit/preset/ios/integration.md +3 -9
- package/resource/knowledge/roomkit/preset/react/integration.md +12 -16
- package/resource/knowledge/trtc/android/TRTCCloud.md +154 -238
- package/resource/knowledge/trtc/android/TRTCCloudDef.md +133 -134
- package/resource/knowledge/trtc/android/TRTCCloudListener.md +86 -120
- package/resource/knowledge/trtc/android/TRTCStatistics.md +10 -10
- package/resource/knowledge/trtc/android/TXAudioEffectManager.md +10 -30
- package/resource/knowledge/trtc/android/TXBeautyManager.md +25 -25
- package/resource/knowledge/trtc/android/TXDeviceManager.md +2 -2
- package/resource/knowledge/trtc/android/TXLiteAVCode.md +12 -12
- package/resource/knowledge/trtc/c++/ITRTCCloud.md +166 -261
- package/resource/knowledge/trtc/c++/ITRTCStatistics.md +12 -12
- package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +10 -30
- package/resource/knowledge/trtc/c++/ITXDeviceManager.md +9 -11
- package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +96 -130
- package/resource/knowledge/trtc/c++/TRTCTypeDef.md +122 -123
- package/resource/knowledge/trtc/c++/TXLiteAVCode.md +12 -12
- package/resource/knowledge/trtc/ios/TRTCCloud.md +168 -255
- package/resource/knowledge/trtc/ios/TRTCCloudDef.md +124 -125
- package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +89 -124
- package/resource/knowledge/trtc/ios/TRTCStatistics.md +10 -10
- package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +9 -28
- package/resource/knowledge/trtc/ios/TXBeautyManager.md +25 -25
- package/resource/knowledge/trtc/ios/TXDeviceManager.md +9 -11
- package/resource/knowledge/trtc/ios/TXLiteAVCode.md +12 -12
- package/server-config.js +7 -4
- package/server.js +21 -21
- package/tools/common/finalize_answer.js +1 -1
- package/tools/common/present_framework_choice.js +2 -2
- package/tools/common/search_trtc_knowledge.js +3 -3
- package/tools/common/submit_feedback.js +1 -1
- package/tools/definitions/get_native_live_uikit_integration_def.js +61 -0
- package/tools/definitions/get_native_livekit_core_integration_def.js +3 -3
- package/tools/definitions/present_framework_choice_def.js +2 -2
- package/tools/definitions/search_trtc_knowledge_def.js +5 -5
- package/tools/index.js +2 -0
- package/tools/live/get_native_live_uikit_integration.js +69 -0
- package/tools/live/get_native_livekit_core_integration.js +6 -6
- package/utils/is-valid-sdkappid.js +4 -0
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/knowledge/callkit/preset/web/api.md +0 -83
- package/resource/knowledge/livekit/core-sdk/live/android/live-audio-effect.md +0 -226
- package/resource/knowledge/livekit/core-sdk/live/android/live-live-list.md +0 -438
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-barrage.md +0 -490
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-live-list.md +0 -726
- package/resource/knowledge/livekit/core-sdk/live/ios/live-audience-list.md +0 -264
- package/resource/knowledge/livekit/core-sdk/live/ios/live-audio-effect.md +0 -216
- package/resource/knowledge/livekit/core-sdk/live/ios/live-gift.md +0 -407
- package/resource/knowledge/livekit/core-sdk/live/ios/live-live-list.md +0 -349
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-audience-list.md +0 -269
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-barrage.md +0 -456
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-gift.md +0 -455
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audience-list.md +0 -260
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audio-effect.md +0 -598
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-gift.md +0 -424
- package/resource/knowledge/livekit/core-sdk/voice/ios/voice-barrage.md +0 -408
- /package/resource/knowledge/livekit/core-sdk/{live/android/live-audience-list.md → features/android/audience-list.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/android/live-barrage.md → features/android/barrage.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/android/live-base-beauty.md → features/android/base-beauty.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/flutter/live-audience-list.md → features/flutter/audience-list.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/flutter/live-base-beauty.md → features/flutter/base-beauty.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/ios/live-barrage.md → features/ios/barrage.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/voice/android/{voice-co-guest-interaction.md → co-guest-interaction.md} +0 -0
package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-integration.md → integration.md}
RENAMED
|
@@ -40,7 +40,6 @@ Call `LoginStore.shared.login` in your project to complete authentication. **Thi
|
|
|
40
40
|
|
|
41
41
|
> **Note:**
|
|
42
42
|
>
|
|
43
|
-
|
|
44
43
|
> We recommend calling LoginStore.shared.login only after your app's own user authentication is successful, to ensure clear and consistent login logic.
|
|
45
44
|
>
|
|
46
45
|
|
|
@@ -121,7 +120,7 @@ class YourAnchorViewController: UIViewController {
|
|
|
121
120
|
}
|
|
122
121
|
```
|
|
123
122
|
|
|
124
|
-
#### **2
|
|
123
|
+
#### **2.** Turn On Microphone
|
|
125
124
|
|
|
126
125
|
Turn On Microphone by calling `openLocalMicrophone` from `DeviceStore`:
|
|
127
126
|
``` swift
|
|
@@ -200,7 +199,6 @@ class YourAnchorViewController: UIViewController {
|
|
|
200
199
|
|
|
201
200
|
> **Note:**
|
|
202
201
|
>
|
|
203
|
-
|
|
204
202
|
> For seat UI logic and effects, refer to the open-source [SeatGridView.swift](https://github.com/Tencent-RTC/TUIKit_iOS/blob/main/live/Sources/Component/SeatGridview/SeatGridView.swift) in TUILiveKit.
|
|
205
203
|
>
|
|
206
204
|
|
|
@@ -380,7 +378,6 @@ In voice chat rooms, it's common to show a wave animation over the avatar of use
|
|
|
380
378
|
|
|
381
379
|
> **Note:**
|
|
382
380
|
>
|
|
383
|
-
|
|
384
381
|
> For a complete implementation of the speaking wave animation, refer to [SeatGridView.swift](https://github.com/Tencent-RTC/TUIKit_iOS/blob/main/live/Sources/Component/SeatGridview/SeatGridView.swift) in TUILiveKit.
|
|
385
382
|
>
|
|
386
383
|
|
|
@@ -85,10 +85,8 @@ onMounted(async () => {
|
|
|
85
85
|
|
|
86
86
|
> **Note:**
|
|
87
87
|
>
|
|
88
|
-
|
|
89
88
|
> Note: To directly learn about the custom details of the Barrage Message Component (BarrageList), quickly jump to the following link: Barrage Message Component Customization;
|
|
90
89
|
>
|
|
91
|
-
|
|
92
90
|
> Note: To directly learn about the custom details of the Message Sending Component (BarrageInput), quickly jump to the following link: Message Sending Component Customization.
|
|
93
91
|
>
|
|
94
92
|
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
## TIMPush - TIMPushManager
|
|
2
|
+
|
|
3
|
+
public abstract class TIMPushManager: Push Plugin Interface Class.
|
|
4
|
+
|
|
5
|
+
### API overview
|
|
6
|
+
|
|
7
|
+
#### Register/Unregister Push Service Interface
|
|
8
|
+
|
|
9
|
+
|API|Description|
|
|
10
|
+
|---------|---------|
|
|
11
|
+
|registerPush|Register Push Service, push information reads the configuration file timpush-configs.json in the project (this interface must be called after the App user has agreed to the privacy policy to use the push service).|
|
|
12
|
+
|unRegisterPush|Unregister and disable the push service.|
|
|
13
|
+
|setRegistrationID|RegistrationID is the unique identifier ID of the push receiving device. By default, this ID is automatically generated when the push service is successfully registered, but you can also customize the setting. You can push messages to the specified device based on the RegistrationID. Note that uninstalling and reinstalling the device will change the RegistrationID, so you need to call the setRegistrationID interface before registering the push service.|
|
|
14
|
+
|getRegistrationID|After successfully registering the push service, you can get the unique identifier ID of the push receiving device, that is, the RegistrationID, by calling the getRegistrationID interface. You can push messages to the specified device based on the RegistrationID.|
|
|
15
|
+
|
|
16
|
+
#### Push global listening interface
|
|
17
|
+
|
|
18
|
+
|API|Description|
|
|
19
|
+
|---------|---------|
|
|
20
|
+
|addPushListener|Add Push listener.|
|
|
21
|
+
|removePushListener|Remove Push listener.|
|
|
22
|
+
|
|
23
|
+
#### Custom Configuration Interface
|
|
24
|
+
|
|
25
|
+
|API|Description|
|
|
26
|
+
|---------|---------|
|
|
27
|
+
|forceUseFCMPushChannel|Specify offline push to use the FCM channel for the device. This needs to be called before registering the push service.|
|
|
28
|
+
|disablePostNotificationInForeground|Disable the notification bar when the app is in the foreground.|
|
|
29
|
+
|
|
30
|
+
### Interface Details
|
|
31
|
+
|
|
32
|
+
#### Static Public Member Functions
|
|
33
|
+
|
|
34
|
+
static TIMPushManager getInstance(): Retrieves the TIMPushManager manager instance.
|
|
35
|
+
|
|
36
|
+
#### Member Function Description
|
|
37
|
+
|
|
38
|
+
##### abstract void registerPush(Context context, int sdkAppId, String appKey, TIMPushCallback callback)
|
|
39
|
+
|
|
40
|
+
Register Push Service. Please correctly pass the parameters sdkAppId and appKey to register the push service.
|
|
41
|
+
|
|
42
|
+
Parameter description:
|
|
43
|
+
| Parameter | Description | Get Path |
|
|
44
|
+
| --- | --- | --- |
|
|
45
|
+
| sdkAppId | The application ID assigned to you by the Chat console. | |
|
|
46
|
+
| appKey | The client key assigned to you by the Chat console. | |
|
|
47
|
+
|
|
48
|
+
##### abstract void unRegisterPush(TIMPushCallback callback)
|
|
49
|
+
|
|
50
|
+
Unregister and disable the push service.
|
|
51
|
+
|
|
52
|
+
##### abstract void setRegistrationID(String registrationID, TIMPushCallback callback)
|
|
53
|
+
|
|
54
|
+
Set the push ID identifier used for registering the push service, i.e., RegistrationID, which needs to be called before registering the push service.
|
|
55
|
+
|
|
56
|
+
Parameter description:
|
|
57
|
+
|
|
58
|
+
|Parameter|Description|
|
|
59
|
+
|---------|---------|
|
|
60
|
+
|registrationID|Unique ID for push notifications on the device, which may change if uninstalled and reinstalled.|
|
|
61
|
+
|
|
62
|
+
##### abstract void getRegistrationID(TIMPushCallback callback)
|
|
63
|
+
|
|
64
|
+
After successfully registering for the push service, obtain the push ID identifier, i.e., RegistrationID.
|
|
65
|
+
|
|
66
|
+
##### abstract void addPushListener(TIMPushListener listener)
|
|
67
|
+
|
|
68
|
+
Add Push listener
|
|
69
|
+
|
|
70
|
+
##### abstract void removePushListener(TIMPushListener listener)
|
|
71
|
+
|
|
72
|
+
Remove Push listener
|
|
73
|
+
|
|
74
|
+
##### abstract void forceUseFCMPushChannel(boolean enable)
|
|
75
|
+
|
|
76
|
+
Specify offline push to use the FCM channel for the device. This needs to be called before registering the push service.
|
|
77
|
+
|
|
78
|
+
Parameter description:
|
|
79
|
+
| Parameter | Description |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| enable | - true: Use FCM channel.<br>- false: use the native channel. |
|
|
82
|
+
|
|
83
|
+
##### abstract void disablePostNotificationInForeground(boolean disable)
|
|
84
|
+
|
|
85
|
+
Disable notification bar pop-ups when the app is in the foreground. When the Push SDK receives an online Push, it will automatically add a Notification to the notification bar. If you want to handle the online Push messages yourself, you can call this interface to disable the automatic notification bar pop-up feature.
|
|
86
|
+
|
|
87
|
+
Parameter description:
|
|
88
|
+
| Parameter | Description |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| disable | - true: disable<br>- false: enable |
|
|
91
|
+
|
|
92
|
+
## TIMPush - TIMPushListener
|
|
93
|
+
|
|
94
|
+
public abstract class TIMPushListener: Push Listener class
|
|
95
|
+
|
|
96
|
+
### API overview
|
|
97
|
+
|
|
98
|
+
|API|Description|
|
|
99
|
+
|---------|---------|
|
|
100
|
+
|onRecvPushMessage|Received Push message.|
|
|
101
|
+
|onRevokePushMessage|Received a notification of Push message recall.|
|
|
102
|
+
|onNotificationClicked|Notification bar message click callback.|
|
|
103
|
+
|
|
104
|
+
### Interface Details
|
|
105
|
+
|
|
106
|
+
#### Member Function Description
|
|
107
|
+
|
|
108
|
+
##### void onRecvPushMessage(TIMPushMessage message)
|
|
109
|
+
|
|
110
|
+
Received Push message, message content.
|
|
111
|
+
|
|
112
|
+
##### void onRevokePushMessage(String messageID)
|
|
113
|
+
|
|
114
|
+
Received a notification of Push message recall, messageID uniquely identifies the message.
|
|
115
|
+
|
|
116
|
+
##### void onNotificationClicked(String ext)
|
|
117
|
+
|
|
118
|
+
Notification bar message click callback.
|
|
119
|
+
|
|
120
|
+
> **Note:**
|
|
121
|
+
>
|
|
122
|
+
> The push certificate in the console needs to be configured as "open a specific interface within the application" and use the default fill value to take effect.
|
|
123
|
+
>
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
## TencentCloudChatPush
|
|
2
|
+
|
|
3
|
+
class TencentCloudChatPush: Push Plugin Interface Class.
|
|
4
|
+
|
|
5
|
+
## API overview
|
|
6
|
+
|
|
7
|
+
### Register/Unregister Push Service Interface
|
|
8
|
+
|
|
9
|
+
|API|Description|
|
|
10
|
+
|---------|---------|
|
|
11
|
+
|registerPush|Register Push Service, optionally override push information from interface parameter JSON.|
|
|
12
|
+
|unRegisterPush|Unregister Push Service.|
|
|
13
|
+
|setRegistrationID|RegistrationID is the unique identifier ID of the push receiving device. By default, this ID is automatically generated when the push service is successfully registered, but you can also customize the setting. You can push messages to the specified device based on the RegistrationID. Note that uninstalling and reinstalling the device will change the RegistrationID, so you need to call the setRegistrationID interface before registering the push service.|
|
|
14
|
+
|getRegistrationID|After successfully registering the push service, you can get the unique identifier ID of the push receiving device, that is, the RegistrationID, by calling the getRegistrationID interface. You can push messages to the specified device based on the RegistrationID.|
|
|
15
|
+
|
|
16
|
+
### Push global listening interface
|
|
17
|
+
|
|
18
|
+
|API|Description|
|
|
19
|
+
|---------|---------|
|
|
20
|
+
|addPushListener|Add Push listener.|
|
|
21
|
+
|removePushListener|Remove Push listener.|
|
|
22
|
+
|
|
23
|
+
### Custom Configuration Interface
|
|
24
|
+
|
|
25
|
+
|API|Description|
|
|
26
|
+
|---------|---------|
|
|
27
|
+
|forceUseFCMPushChannel|Specify offline push to use the FCM channel for the device. This needs to be called before registering the push service.|
|
|
28
|
+
|disablePostNotificationInForeground|Disable the notification bar when the app is in the foreground.|
|
|
29
|
+
|
|
30
|
+
## Interface Details
|
|
31
|
+
|
|
32
|
+
### Push Plugin Class
|
|
33
|
+
|
|
34
|
+
TencentCloudChatPush(): Get the TencentCloudChatPush plugin instance, which is a static singleton. Subsequent steps are performed through this singleton instance for method calls.
|
|
35
|
+
|
|
36
|
+
### Member Function Description
|
|
37
|
+
|
|
38
|
+
#### registerPush
|
|
39
|
+
|
|
40
|
+
Register Push Service, to be called after Chat account login is successful.
|
|
41
|
+
|
|
42
|
+
**Sample code:**
|
|
43
|
+
``` java
|
|
44
|
+
void _onNotificationClicked({required String ext, String? userID, String? groupID}) {
|
|
45
|
+
print("_onNotificationClicked: $ext, userID: $userID, groupID: $groupID");
|
|
46
|
+
/// Custom Processing
|
|
47
|
+
}
|
|
48
|
+
TencentCloudChatPush().registerPush(
|
|
49
|
+
onNotificationClicked: _onNotificationClicked,
|
|
50
|
+
sdkAppId: Your sdkAppId,
|
|
51
|
+
appKey: "client key",
|
|
52
|
+
apnsCertificateID: Your configured Certificate ID);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Parameter description:**
|
|
56
|
+
| Parameter | Type | Description | |
|
|
57
|
+
| --- | --- | --- | --- |
|
|
58
|
+
| onNotificationClicked | ext | String | The complete ext information carried by the message is specified by the sender. If not specified, there is a default value. You can parse this field to navigate to the corresponding page. |
|
|
59
|
+
| userID | String? | This parameter corresponds to userID. It automatically tries to parse the ext JSON String to obtain the userID of the other party in a single chat.<br><strong>Note:</strong><br>If you have not customized the ext field, which is specified by the SDK or UIKit by default, you can use the default parsing here. If the parsing attempt fails, it will be null. | |
|
|
60
|
+
| groupID | String? | This parameter corresponds to groupID. It automatically tries to parse the ext JSON String to obtain the groupID information for group chats.<br><strong>Note:</strong><br>If you have not customized the ext field, which is specified by the SDK or UIKit by default, you can use the default parsing here. If the parsing attempt fails, it will be null. | |
|
|
61
|
+
| sdkAppId | int? | The application ID assigned to you by the Chat console | |
|
|
62
|
+
| appKey | String? | Client key assigned to you by the Chat console | |
|
|
63
|
+
| apnsCertificateID | int? | This item can be omitted if the setApnsCertificateID method is already configured separately. | |
|
|
64
|
+
|
|
65
|
+
#### unRegisterPush
|
|
66
|
+
|
|
67
|
+
Unregister offline push service.
|
|
68
|
+
|
|
69
|
+
**Sample code:**
|
|
70
|
+
``` java
|
|
71
|
+
TencentCloudChatPush().unRegisterPush();
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### setRegistrationID
|
|
75
|
+
|
|
76
|
+
Set the push ID used for registering the offline push service, that is, the RegistrationID, which needs to be called before registering the push service.
|
|
77
|
+
|
|
78
|
+
Parameter description:
|
|
79
|
+
|
|
80
|
+
|Parameter|Description|
|
|
81
|
+
|---------|---------|
|
|
82
|
+
|registrationID|Device push ID, which will change after uninstalling and reinstalling.|
|
|
83
|
+
|
|
84
|
+
**Sample code:**
|
|
85
|
+
``` java
|
|
86
|
+
TencentCloudChatPush().setRegistrationID(registrationID: registrationID);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### getRegistrationID
|
|
90
|
+
|
|
91
|
+
After successfully registering for the offline push service, obtain the push ID, that is, the RegistrationID.
|
|
92
|
+
|
|
93
|
+
**Sample code:**
|
|
94
|
+
``` java
|
|
95
|
+
TencentCloudChatPush().getRegistrationID();
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### addPushListener
|
|
99
|
+
|
|
100
|
+
Add Push listener
|
|
101
|
+
|
|
102
|
+
**Sample code:**
|
|
103
|
+
``` java
|
|
104
|
+
TIMPushListener timPushListener = TIMPushListener(
|
|
105
|
+
onRecvPushMessage: (TimPushMessage message) {
|
|
106
|
+
String messageLog = message.toLogString();
|
|
107
|
+
debugPrint(
|
|
108
|
+
"message: $messageLog");
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
onRevokePushMessage: (String messageId) {
|
|
112
|
+
debugPrint(
|
|
113
|
+
"message: $messageId");
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
onNotificationClicked: (String ext) {
|
|
117
|
+
debugPrint(
|
|
118
|
+
"ext: $ext");
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
TencentCloudChatPush.addPushListener(listener: timPushListener);
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### removePushListener
|
|
125
|
+
|
|
126
|
+
Remove Push listener
|
|
127
|
+
|
|
128
|
+
**Sample code:**
|
|
129
|
+
``` java
|
|
130
|
+
TIMPushListener timPushListener = TIMPushListener(
|
|
131
|
+
onRecvPushMessage: (TimPushMessage message) {
|
|
132
|
+
String messageLog = message.toLogString();
|
|
133
|
+
debugPrint(
|
|
134
|
+
"message: $messageLog");
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
onRevokePushMessage: (String messageId) {
|
|
138
|
+
debugPrint(
|
|
139
|
+
"message: $messageId");
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
onNotificationClicked: (String ext) {
|
|
143
|
+
debugPrint(
|
|
144
|
+
"ext: $ext");
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
TencentCloudChatPush.removePushListener(listener: timPushListener);
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### forceUseFCMPushChannel
|
|
151
|
+
|
|
152
|
+
Specify offline push to use the FCM channel for the device. This needs to be called before registering the push service.
|
|
153
|
+
|
|
154
|
+
Parameter description:
|
|
155
|
+
| Parameter | Description |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| enable | - true: Use FCM channel.<br>- false: use the native channel. |
|
|
158
|
+
|
|
159
|
+
**Sample code:**
|
|
160
|
+
``` java
|
|
161
|
+
TencentCloudChatPush.forceUseFCMPushChannel(enable: true);
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### disablePostNotificationInForeground
|
|
165
|
+
|
|
166
|
+
Disable notification bar pop-ups when the app is in the foreground. When the Push SDK receives an online Push, it will automatically add a Notification to the notification bar. If you want to handle the online Push messages yourself, you can call this interface to disable the automatic notification bar pop-up feature.
|
|
167
|
+
|
|
168
|
+
Parameter description:
|
|
169
|
+
| Parameter | Description |
|
|
170
|
+
| --- | --- |
|
|
171
|
+
| disable | - true: disable<br>- false: enable |
|
|
172
|
+
|
|
173
|
+
**Sample code:**
|
|
174
|
+
``` java
|
|
175
|
+
TencentCloudChatPush.disablePostNotificationInForeground(disable: true);
|
|
176
|
+
```
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
## TIMPushManager API Overview
|
|
2
|
+
| API | Description |
|
|
3
|
+
| --- | --- |
|
|
4
|
+
| registerPush | Register push service (call this API to use push service only after obtaining user consent for the privacy policy). |
|
|
5
|
+
| unRegisterPush | Unregister and disable push service. |
|
|
6
|
+
| setRegistrationID | - RegistrationID is the unique identifier of the push reception device.<br>- By default, it is system-generated when push service registration succeeds. You can also set custom registration ID.<br>- Based on RegistrationID, you can send push messages to specified devices.<br>- Note that uninstalling and reinstalling the device will change the RegistrationID, so you need to call the setRegistrationID API before registering the push service. |
|
|
7
|
+
| getRegistrationID | After successfully registering the push service, call this API to get the unique identifier of the push reception device, namely RegistrationID. |
|
|
8
|
+
| addPushListener | Add a Push Listener. |
|
|
9
|
+
| removePushListener | Remove a Push Listener. |
|
|
10
|
+
| disablePostNotificationInForeground | Enable/disable notification bar notifications when the app is in the foreground (default: enabled). |
|
|
11
|
+
|
|
12
|
+
## API Detail
|
|
13
|
+
|
|
14
|
+
### Register Push Service
|
|
15
|
+
|
|
16
|
+
#### API
|
|
17
|
+
``` tsx
|
|
18
|
+
registerPush(
|
|
19
|
+
context: Context,
|
|
20
|
+
sdkAppId?: number,
|
|
21
|
+
appKey?: string,
|
|
22
|
+
businessId?: number
|
|
23
|
+
): Promise<TIMPushResult>;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
#### Parameter description:
|
|
27
|
+
| Parameter | Type | Description | Access Path |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| context | Context | application context | - |
|
|
30
|
+
| sdkAppId | number | Push Service SDKAppID. | <a href="https://console.trtc.io/chat/push-plugin-push-identifier">Chat > Push > Access Settings</a> page |
|
|
31
|
+
| appKey | String | Push Service client key. | |
|
|
32
|
+
| businessId | number | Certificate ID assigned in the Chat console. | |
|
|
33
|
+
|
|
34
|
+
### Unregistering and Disabling Push Service
|
|
35
|
+
|
|
36
|
+
#### API
|
|
37
|
+
``` tsx
|
|
38
|
+
unRegisterPush(): Promise<TIMPushResult>;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Setting Push ID Identifier RegistrationID
|
|
42
|
+
|
|
43
|
+
> **Note:**
|
|
44
|
+
>
|
|
45
|
+
> 1. If you call this API, ensure to call it before `registerPush`.
|
|
46
|
+
|
|
47
|
+
#### API
|
|
48
|
+
``` tsx
|
|
49
|
+
setRegistrationID(registrationID: string): Promise<TIMPushResult>;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### Parameter description:
|
|
53
|
+
|
|
54
|
+
|Parameter|Type|Description|
|
|
55
|
+
|---------|---------|---------|
|
|
56
|
+
|registrationID|String|Custom push ID identifier.|
|
|
57
|
+
|
|
58
|
+
### Getting Push ID Identifier RegistrationID
|
|
59
|
+
|
|
60
|
+
> **Note:**
|
|
61
|
+
>
|
|
62
|
+
> Note: If you have called the `setRegistrationID` API to set an identifier ID, this API will return the identifier ID you have set. Otherwise, it will return a random value generated by the Push SDK.
|
|
63
|
+
>
|
|
64
|
+
|
|
65
|
+
#### API
|
|
66
|
+
``` tsx
|
|
67
|
+
getRegistrationID(): Promise<TIMPushResult>;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Adding a Push Listener
|
|
71
|
+
|
|
72
|
+
#### API
|
|
73
|
+
``` tsx
|
|
74
|
+
addPushListener(listener: TIMPushListener): void;
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### Parameter description:
|
|
78
|
+
|
|
79
|
+
|Parameter|Type|Description|
|
|
80
|
+
|---------|---------|---------|
|
|
81
|
+
|listener|TIMPushListener|Push event processing method|
|
|
82
|
+
|
|
83
|
+
### Removing a Push Listener
|
|
84
|
+
|
|
85
|
+
#### API
|
|
86
|
+
``` tsx
|
|
87
|
+
removePushListener(listener: TIMPushListener): void;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### Parameter description:
|
|
91
|
+
|
|
92
|
+
|Parameter|Type|Description|
|
|
93
|
+
|---------|---------|---------|
|
|
94
|
+
|listener|TIMPushListener|Push event processing method|
|
|
95
|
+
|
|
96
|
+
### Enabling/Disabling Notification Bar Notifications When the App Is in the Foreground
|
|
97
|
+
|
|
98
|
+
#### API
|
|
99
|
+
``` tsx
|
|
100
|
+
disablePostNotificationInForeground(disable: boolean): void;
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### Parameter description:
|
|
104
|
+
| Parameter | Type | Description |
|
|
105
|
+
| --- | --- | --- |
|
|
106
|
+
| disable | boolean | Enable/disable notification bar notifications when the app is in the foreground (default: off).<br>- Disable notification bar notifications when the app is in the foreground.<br>- false: Enable notification bar notifications when the app is in the foreground. |
|
|
107
|
+
|
|
108
|
+
## TIMPushListener API Overview
|
|
109
|
+
|
|
110
|
+
|API|Description|
|
|
111
|
+
|---------|---------|
|
|
112
|
+
|onRecvPushMessage|Received a Push message.|
|
|
113
|
+
|onRevokePushMessage|Received a Push message recall notification.|
|
|
114
|
+
|onNotificationClicked|Click the notification bar message Webhook.|
|
|
115
|
+
|
|
116
|
+
### API Detail
|
|
117
|
+
|
|
118
|
+
#### Member Function Description
|
|
119
|
+
|
|
120
|
+
##### onMessageReceived(message: TIMPushMessage): void;
|
|
121
|
+
|
|
122
|
+
Received a Push message. Received a message.
|
|
123
|
+
|
|
124
|
+
##### onRevokePushMessage(messageID: string): void;
|
|
125
|
+
|
|
126
|
+
Received a Push message recall notification with the unique message identifier messageID.
|
|
127
|
+
|
|
128
|
+
##### onNotificationClicked(ext: string): void;
|
|
129
|
+
|
|
130
|
+
Click the notification bar message Webhook.
|
|
131
|
+
|
|
132
|
+
## TIMPushResult API Overview
|
|
133
|
+
|
|
134
|
+
|Field|Description|Type|
|
|
135
|
+
|---------|---------|---------|
|
|
136
|
+
|code|Error code|number|
|
|
137
|
+
|message|Error Description|string|
|
|
138
|
+
|data|Return Values|unknown|
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
## TIMPush - TIMPushManager
|
|
2
|
+
|
|
3
|
+
@interface TIMPushManager : NSObject :Push Plugin Interface Class.
|
|
4
|
+
|
|
5
|
+
### API overview
|
|
6
|
+
|
|
7
|
+
#### Register/Unregister Push Service Interface
|
|
8
|
+
|
|
9
|
+
|API|Description|
|
|
10
|
+
|---------|---------|
|
|
11
|
+
|registerPush|Register Push Service (Must be called after the App user has agreed to the privacy policy to use the push service).|
|
|
12
|
+
|unRegisterPush|Unregister and disable the push service.|
|
|
13
|
+
|setRegistrationID|RegistrationID is the unique identifier ID of the push receiving device. By default, this ID is automatically generated when the push service is successfully registered, but you can also customize the setting. You can push messages to the specified device based on the RegistrationID. Note that uninstalling and reinstalling the device will change the RegistrationID, so you need to call the setRegistrationID interface before registering the push service.|
|
|
14
|
+
|getRegistrationID|After successfully registering the push service, you can get the unique identifier ID of the push receiving device, that is, the RegistrationID, by calling the getRegistrationID interface. You can push messages to the specified device based on the RegistrationID.|
|
|
15
|
+
|
|
16
|
+
#### Push global listening interface
|
|
17
|
+
|
|
18
|
+
|API|Description|
|
|
19
|
+
|---------|---------|
|
|
20
|
+
|addPushListener|Add Push listener.|
|
|
21
|
+
|removePushListener|Remove Push listener.|
|
|
22
|
+
|
|
23
|
+
#### Custom Configuration Interface
|
|
24
|
+
|
|
25
|
+
Set whether to display push notifications in the foreground of the app
|
|
26
|
+
|
|
27
|
+
|API|Description|
|
|
28
|
+
|---------|---------|
|
|
29
|
+
|disablePostNotificationInForeground|Disable the notification bar when the app is in the foreground.|
|
|
30
|
+
|
|
31
|
+
### Statistics for TIMPush's Push Arrival Rate
|
|
32
|
+
|
|
33
|
+
If you need to track push arrival and click data, you need to proactively call this function in the Notification Service Extension.
|
|
34
|
+
| API | Description |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| handleNotificationServiceRequest:appGroupID:callback: | - Only support calling in Notification Service Extension's '- didReceiveNotificationRequest:withContentHandler:' method.<br>- The appGroup identifies the App Group shared between the main app and the Extension. It needs to be configured in the App Groups capability of the main app's capability. |
|
|
37
|
+
|
|
38
|
+
### Interface Details
|
|
39
|
+
|
|
40
|
+
#### Function description
|
|
41
|
+
|
|
42
|
+
##### + (void)registerPush:(int) sdkAppId appKey:(NSString *) appKey succ:(TIMPushSuccessCallback) successCallback fail:(TIMPushFailedCallback) failedCallback;
|
|
43
|
+
|
|
44
|
+
Register Push Service. Please correctly pass the parameters sdkAppId and appKey to register the push service.
|
|
45
|
+
- Parameter description:
|
|
46
|
+
|
|
47
|
+
| Parameter | Description | Get Path |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| sdkAppId | The application ID assigned to you by the Chat console. | |
|
|
50
|
+
| appKey | The client key assigned to you by the Chat console. | |
|
|
51
|
+
|
|
52
|
+
- Sample code:
|
|
53
|
+
|
|
54
|
+
``` java
|
|
55
|
+
const int sdkAppId = your sdkAppId;
|
|
56
|
+
static const NSString *appKey = @"Client Key";
|
|
57
|
+
|
|
58
|
+
[TIMPushManager registerPush:sdkAppId appKey:appKey succ:^(NSData * _Nonnull deviceToken) {
|
|
59
|
+
//
|
|
60
|
+
} fail:^(int code, NSString * _Nonnull desc) {
|
|
61
|
+
//error
|
|
62
|
+
}];
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
##### + (void)unRegisterPush:(TIMPushCallback) successCallback fail:(TIMPushFailedCallback) failedCallback;
|
|
66
|
+
|
|
67
|
+
Unregister and disable the push service
|
|
68
|
+
- Sample code:
|
|
69
|
+
|
|
70
|
+
``` java
|
|
71
|
+
[TIMPushManager unRegisterPush:^{
|
|
72
|
+
//success
|
|
73
|
+
} fail:^(int code, NSString * _Nonnull desc) {
|
|
74
|
+
//error
|
|
75
|
+
}];
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
##### + (void)setRegistrationID:(NSString *)registrationID callback: (TIMPushCallback) callback;
|
|
79
|
+
|
|
80
|
+
Set the push ID identifier used for registering the push service, i.e., RegistrationID, which needs to be called before registering the push service.
|
|
81
|
+
- Parameter description:
|
|
82
|
+
|
|
83
|
+
|Parameter|Description|
|
|
84
|
+
|---------|---------|
|
|
85
|
+
|registrationID|The device's push identifier ID will change if you uninstall and reinstall.|
|
|
86
|
+
|
|
87
|
+
##### + (void)getRegistrationID:(TIMPushValueCallback) callback;
|
|
88
|
+
|
|
89
|
+
After successfully registering the push service, obtain the push ID identifier, i.e., RegistrationID.
|
|
90
|
+
|
|
91
|
+
##### + (void)addPushListener:(id<TIMPushListener>)listener
|
|
92
|
+
|
|
93
|
+
Add Push listener.
|
|
94
|
+
|
|
95
|
+
##### + (void)removePushListener:(id<TIMPushListener>)listener
|
|
96
|
+
|
|
97
|
+
Remove Push listener.
|
|
98
|
+
|
|
99
|
+
##### + (void)disablePostNotificationInForeground:(BOOL)disable;
|
|
100
|
+
|
|
101
|
+
Disable notification bar pop-ups when the app is in the foreground. When the Push SDK receives an online Push, it will automatically add a Notification to the notification bar. If you want to handle the online Push messages yourself, you can call this interface to disable the automatic notification bar pop-up feature.
|
|
102
|
+
- Parameter description:
|
|
103
|
+
|
|
104
|
+
| Parameter | Description |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| disable | - true: disable<br>- false: enable |
|
|
107
|
+
|
|
108
|
+
##### + (void)handleNotificationServiceRequest:(UNNotificationRequest *)request appGroupID:(NSString *)appGroupID callback:(TIMPushNotificationExtensionCallback)callback
|
|
109
|
+
|
|
110
|
+
Statistics for TIMPush's Push Arrival Rate
|
|
111
|
+
1. You need to implement the `- applicationGroupID` method in the AppDelegate.m file, returning the App Group ID.
|
|
112
|
+
|
|
113
|
+
2. And call this function in the Notification Service Extension's '- didReceiveNotificationRequest:withContentHandler:' method.
|
|
114
|
+
|
|
115
|
+
> **Note:**
|
|
116
|
+
>
|
|
117
|
+
> The appGroup identifies the App Group shared between the main app and the Extension. It needs to be configured in the App Groups capability of the main app's capability.
|
|
118
|
+
>
|
|
119
|
+
|
|
120
|
+
- Parameter description:
|
|
121
|
+
|
|
122
|
+
| request | <a href="https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension/1648229-didreceivenotificationrequest">Parameters carried by the UNNotificationServiceExtension callback</a> |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| appGroupID | The appGroup identifies the App Group shared between the main app and the Extension. It needs to be configured in the App Groups capability of the main app's capability. |
|
|
125
|
+
| callback | typedef void(^TIMPushNotificationExtensionCallback)(UNNotificationContent *content) Statistics function callback, carrying content information |
|
|
126
|
+
|
|
127
|
+
- Sample code:
|
|
128
|
+
|
|
129
|
+
``` java
|
|
130
|
+
|
|
131
|
+
@implementation NotificationService
|
|
132
|
+
|
|
133
|
+
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
|
|
134
|
+
//The appGroup identifies the App Group shared between the main app and the Extension. It needs to be configured in the App Groups capability of the main app's capability.
|
|
135
|
+
//Format: group + [mainBundleID] + key
|
|
136
|
+
//E.g., group.com.tencent.im.pushkey
|
|
137
|
+
NSString * appGroupID = kTIMPushAppGorupKey;
|
|
138
|
+
__weak typeof(self) weakSelf = self;
|
|
139
|
+
[TIMPushManager handleNotificationServiceRequest:request appGroupID:appGroupID callback:^(UNNotificationContent *content) {
|
|
140
|
+
weakSelf.bestAttemptContent = [content mutableCopy];
|
|
141
|
+
// Modify the notification content here...
|
|
142
|
+
// self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]", self.bestAttemptContent.title];
|
|
143
|
+
weakSelf.contentHandler(weakSelf.bestAttemptContent);
|
|
144
|
+
}];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@end
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## TIMPush - TIMPushListener
|
|
151
|
+
|
|
152
|
+
@protocol TIMPushListener <NSObject> :Push Listener Protocol
|
|
153
|
+
|
|
154
|
+
### API overview
|
|
155
|
+
|
|
156
|
+
|API|Description|
|
|
157
|
+
|---------|---------|
|
|
158
|
+
|onRecvPushMessage|Received Push message|
|
|
159
|
+
|onRevokePushMessage|Received a notification of Push message recall|
|
|
160
|
+
|onNotificationClicked|Notification bar message click callback|
|
|
161
|
+
|
|
162
|
+
### Interface Details
|
|
163
|
+
|
|
164
|
+
#### Member Function Description
|
|
165
|
+
|
|
166
|
+
##### - (void)onRecvPushMessage:(TIMPushMessage *)message;
|
|
167
|
+
|
|
168
|
+
Received Push message, message content.
|
|
169
|
+
|
|
170
|
+
##### - (void)onRevokePushMessage:(NSString *)messageID;
|
|
171
|
+
|
|
172
|
+
Received a notification of Push message recall, messageID uniquely identifies the message.
|
|
173
|
+
|
|
174
|
+
##### - (void)onNotificationClicked:(NSString *)ext;
|
|
175
|
+
|
|
176
|
+
Notification bar message click callback.
|