简体   繁体   English

Android QuickBlox通话

[英]Android QuickBlox call

I'm trying to integrate QuickBlox for audio and video calls. 我正在尝试将QuickBlox集成到音频和视频通话中。 I followed tutorial but it doesn't work. 我遵循了教程,但是没有用。 To enable an ability of receiving incoming WebRTC calls need add signalling manager but method 为了能够接收传入的WebRTC呼叫,需要添加信令管理器,但是方法

    public void signalingCreated(QBSignaling qbSignaling, boolean createdLocally)

doesn't call. 不打。 What is wrong? 怎么了? jniLibs and permissions added build: added dependency jniLib和权限已添加构建:已添加依赖项

    compile 'com.quickblox:quickblox-android-sdk-videochat-webrtc:3.3.0'

Here code: 这里的代码:

private EditText mUsername;
private EditText mPassword;
private Button mSignUp;
private Button mSignIn;
private Button mCall;
private QBUser mUser;


QBRTCClient client;
QBSessionManager sessionManager;
QBChatService chatService;
QBRTCSession qbrtcSession;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    QBSettings.getInstance().init(getApplicationContext(), APP_ID, AUTH_KEY, AUTH_SECRET);
    QBSettings.getInstance().setAccountKey(ACCOUNT_KEY);

    mUsername = (EditText) findViewById(R.id.username);
    mPassword = (EditText) findViewById(R.id.password);
    mSignIn = (Button) findViewById(R.id.sign_in);
    mSignUp = (Button) findViewById(R.id.sign_up);
    mCall = (Button) findViewById(R.id.button_call);
    client = QBRTCClient.getInstance(MainActivity.this);

    QBChatService.setDebugEnabled(true);
    QBChatService.setDefaultAutoSendPresenceInterval(60);
    chatService = QBChatService.getInstance();

    mSignIn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            mUser = new QBUser(mUsername.getText().toString(), mPassword.getText().toString());
           // QBUsers.signIn(mUser).performAsync(new QBEntityCallback<QBUser>() {
            QBAuth.createSession(mUser).performAsync(new QBEntityCallback<QBSession>() {
                @Override
                public void onSuccess(QBSession qbUser, Bundle bundle) {
                    Log.d(TAG, "My user: " + mUser);
                    Log.d(TAG, "received user: " + qbUser);
                    Log.d(TAG, "user logged in");
                    mUser.setId(qbUser.getUserId());

                    chatService.login(mUser, new QBEntityCallback<QBUser>() {
                        @Override
                        public void onSuccess(QBUser qbUser, Bundle bundle) {
                            Log.d(TAG, "user logged in to the chat");
                            client.prepareToProcessCalls();
                            chatService.getVideoChatWebRTCSignalingManager().addSignalingManagerListener(new QBVideoChatSignalingManagerListener() {
                                @Override
                                public void signalingCreated(QBSignaling qbSignaling, boolean createdLocally) {
                                    Log.d(TAG, "created locally: " + createdLocally);
                                    if (!createdLocally) {
                                        client.addSignaling((QBWebRTCSignaling) qbSignaling);
                                    }
                                }
                            });

This line never call: 该行永远不会调用:

    Log.d(TAG, "created locally: " + createdLocally);

the method signalingCreated() is called when you make a call or when you get a call. 当您拨打电话或接到电话时,将调用signalingCreated()方法。 You can look at video sample it works all ok. 您可以看一下视频示例 ,一切正常。 BTW, you don't need to manage session manually and there is no need to call createSession methods. 顺便说一句,您不需要手动管理会话,也不需要调用createSession方法。 Just use QBUsers.signIn(). 只需使用QBUsers.signIn()。 Documentation . 文件资料

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM