0

I'm trying to integrate QuickBlox for audio and video calls. I followed tutorial but it doesn't work. To enable an ability of receiving incoming WebRTC calls need add signalling manager but method

    public void signalingCreated(QBSignaling qbSignaling, boolean createdLocally)

doesn't call. What is wrong? jniLibs and permissions added build: added dependency

    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);
Neo Phone
  • 1
  • 1

1 Answers1

0

the method signalingCreated() is called when you make a call or when you get a call. 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. Just use QBUsers.signIn(). Documentation.

RustyBoy
  • 26
  • 2
  • I have already found solution but thanks anyway. About QBUser you shouldn't even signIn, enough create new QBUser with id and password – Neo Phone Mar 02 '17 at 17:55