You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android平台QuickBlox回调失效求助:CallService无法接收会话回调

Hey there, let's dig into why your CallService callbacks aren't firing. Looking at your code, I spotted a key issue that's likely causing this:

The Core Problem

In your initQBRTCClient() method, you're adding WebRtcSessionManager.getInstance(this) as the session callbacks listener instead of the CallService itself. Since your CallService implements QBRTCClientSessionCallbacks and QBRTCSessionConnectionCallbacks, but isn't registered as a listener, those callback methods in CallService will never get triggered.

Fix the Listener Registration

Update this line in initQBRTCClient():

rtcClient.addSessionCallbacksListener(WebRtcSessionManager.getInstance(this));

To:

rtcClient.addSessionCallbacksListener(this);

Additional Checks to Ensure Success

Let's confirm a few other setup details to rule out edge cases:

  • QBSettings Initialization: The QBSettings setup code in onCreate() is commented out. Make sure this is properly initialized elsewhere in your app before starting the CallService (without this, chat and RTC functionality won't work).
  • Chat Login Success: Check the onSuccess log in loginToChat() to verify the chat login completes successfully. If login fails, the RTC client won't be initialized properly.
  • Push Notification Data: Ensure the push notification's message parameter is correctly passed, so the code triggering CallService.start() actually runs.
  • Debug Logs: Since QBRTCConfig.setDebugEnabled(true) is enabled, check for detailed RTC-related logs in Logcat after fixing the listener — these can help identify if there are still connection or signaling issues.

Once you update the listener registration, your onReceiveNewSession() and other callback methods should start receiving events and logging those Log.d(TAG, ""+1); lines as expected.

内容的提问来源于stack exchange,提问作者T Quick

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:07:11