quickblox-javascript-sdk

JavaScript SDK of QuickBlox cloud backend platform

OTHER License

Downloads
9.1K
Stars
105
Committers
29

Bot releases are hidden (Show)

quickblox-javascript-sdk - 2.12.0

Published by dimaspirit over 6 years ago

Removed:

  • Remove unused samples (users, roster). All cases will be shown at chat, data, webrtc samples;
  • The window.navigator.onLine check was remove (the check was move to the WebRTC Sample); To make sure that a client has internet connecteion before make a call;

Fixed:

  • during the call (WebRTC session) the WebRTC Sample will be able to switch to other camera, if it is possible and would stop call if all media devices were unplugged;
  • bugs were fixed when user doesn't allow permanent permissions for getUserMedia;

Added:

  • Ability to restore connect to chat by time interval after disconnect, if it wasn't voluntary (Added for node-xmpp-client and nativescript-xmpp-client, updated for Strophe.js client).
    Add a property chatReconnectionTimeInterval to config, by default is 5 sec;
    QB.chat.disconnect() stops reconnection actions;
  • The call of QB.chat.connect(params, callback) when chat is in connecting state (the connection one by one) was blocked, the callback funtion will return an error ('Status.REJECT - The connection is still in the Status.CONNECTING state');
  • QB.webrtc.onDevicesChangeListener() was added - the listener that is called when a media device has been plugged or unplugged;
  • An ability to change audio and video tracks was added (switch cameras), use the method webRTCSession.switchMediaTracks(deviceIds, cb).
    Supported and tested on Firefox from v.60.

Here is code snippet how to replace audio/video tracks:

var switchMediaTracksBtn = document.getElementById('confirmSwitchMediaTracks');

var webRTCSession = QB.webrtc.createNewSession(params);

QB.webrtc.getMediaDevices('videoinput').then(function(devices) {
    var selectVideoInput = document.createElement('select'),
        selectVideoInput.id = 'videoInput',
        someDocumentElement.appendChild(selectVideoInput);

    if (devices.length > 1) {
        for (var i = 0; i !== devices.length; ++i) {
            var device = devices[i],
                option = document.createElement('option');

            if (device.kind === 'videoinput') {
                option.value = device.deviceId;
                option.text = device.label;
                selectVideoInput.appendChild(option);
            }
        }
    }
}).catch(function(error) {
    console.error(error);
});

QB.webrtc.getMediaDevices('audioinput').then(function(devices) {
    var selectAudioInput = document.createElement('select'),
        selectAudioInput.id = 'audioInput',
        someDocumentElement.appendChild(selectAudioInput);

    if (devices.length > 1) {
        for (var i = 0; i !== devices.length; ++i) {
            var device = devices[i],
                option = document.createElement('option');

            if (device.kind === 'audioinput') {
                option.value = device.deviceId;
                option.text = device.label;
                selectAudioInput.appendChild(option);
            }
        }
    }
}).catch(function(error) {
    console.error(error);
});

switchMediaTracksBtn.onclick = function(event) {
    var audioDeviceId = document.getElementById('audioInput').value || undefined,
        videoDeviceId = document.getElementById('videoInput').value || undefined,
        deviceIds = {
            audio: audioDeviceId,
            video: videoDeviceId,
        };

    var callback = function(error, stream) {
            if (err) {
                console.error(error);
            } else {
                console.log(stream);
            }
         };

    // Switch media tracks in audio/video HTML's element (the local stream)
    // replace media tracks in peers (will change media tracks for each user in WebRTC session)
    webRTCSession.switchMediaTracks(deviceIds, callback);
}
quickblox-javascript-sdk - 2.11.0

Published by dimaspirit over 6 years ago

New:

  • Add header 'QB-OS' in all API requests for improving analytics;

Updated:

  • Encode body of all API requests;
    Encode based on this https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters;

  • Rework muc.join method:

    • Rework putting parameters of the muc.join method. Now could pass jid or id of a dialog;
    • Now uses Node.js callbacks approach instead of a returned stanza if you pass 2 arguments to the callback function. If you pass 1 arguments you will get stanza element as before;
QB.chat.muc.join(dialogId, function(error, response) {
   if(error) {
      console.log('Error is null when all is Ok');
  }

  console.log(`response.dialogId` is always contains in response);
});
  • QB.webrtc.onCallStatsReport(session, userId, stats, error) will return new (uptaded) stats:
stats = {
    local: {
        audio: {
            bitrate: 71, // kilobits per second (kbps)
            bytesSent: 226410,
            packetsSent: 1250, 
            timestamp: 1522680935736
        },
        video: {
            frameHeight: 480,
            frameWidth: 640,
            framesPerSecond: 25.8,
            bitrate: 498,  // kilobits per second (kbps)
            bytesSent: 1438862, 
            packetsSent: 1498,
            timestamp: 1522680935736
        },
        candidate: {
            protocol: "udp"
            ip: "192.168.1.179"
            port: 51038
        }
    },
    remote: {
        audio: {
            bitrate: 47, // kilobits per second (kbps)
            bytesReceived: 148211,
            packetsReceived: 1250,
            timestamp: 1522680935736
        },
        video: {
            frameHeight: 480,
            frameWidth: 640,
            framesPerSecond: 30.4,
            bitrate: 533, // kilobits per second (kbps)
            bytesReceived: 1663716,
            packetsReceived: 1498,
            timestamp: 1522680935736
        },
        candidate: {
            protocol: "udp",
            ip: "192.168.1.179",
            port: 51908
        }
    }
}
quickblox-javascript-sdk - 2.10.0

Published by dimaspirit over 6 years ago

Improvements / Updated:

  • Add the opportunity to choose crypto standard (sha1, sha256);
    By default, uses sha1. If you want to use sha256 add hash property to config;
var CONFIG = {
  debug: {mode: 1},
  hash: 'sha256'
};
QB.init(3477, 'ChRnwEJ3WzxH9O4', 'AS546kpUQ2tfbvv', CONFIG);
quickblox-javascript-sdk - 2.9.0

Published by dimaspirit over 6 years ago

Added:

  • Add possibility to set a bandwidth limit for the video call.
    Set the bandwidth at create sssion by QB.webrtc.createNewSession(calleesIds, sessionType, callerID, { bandwidth: Number });.

  • Add DELETE Custom Object by criteria by updated a method QB.data.delete.
    Now the method takes QB.data.delete(className, {string|array|object}, callback) where second parameter an id (String) or a list of ids (Array) or criteria rules (Object) to delete.
    Check out docs for more details;

Updated:

  • Normalize an answer on DELETE Custom Object by criteria for any passed types.
    Check out docs for more details;

  • Update QB.webrtc.onCallStatsReport(session, userId, stats, error) listener;

Samples:

  • Add ability set credentials and endpoints by search param of URL in webRTC sample:
    https//:www.host.com/?appId={Number}&authKey={String}&authSecret={String}&endpoints.api={String}&endpoints.chat={String}.
    Also remove production configuration/app and leave stage app configuration;

  • Add a bandwidth configuration to WebRTC sample;

  • Remove code for "Hack for Firefox" (https://bugzilla.mozilla.org/show_bug.cgi?id=852665) cause we are support FF52+ now;

quickblox-javascript-sdk - 2.8.1

Published by Vladlukhanin over 6 years ago

Fixed:

  • the Fetch API (if a response is an empty body);
  • the header 'Content-Type' in the qbData module;
  • the header 'QB-SDK' for REST API requests;
  • the QB.chat.message.unreadCount() method;
  • the QB.chat.dialog.create() method;
  • the QB.users.listUsers() method;

Samples:

quickblox-javascript-sdk - 2.8.0 - NativeScript support

Published by dimaspirit almost 7 years ago

Improvements:

  • Added fetch API instead $.ajax() and request() (REST API support for NativeScript);
  • Chat adapted for NativeScript enviroments;
  • The MessageProxy and the DialogProxy were remove from qbChat.js to separate modules;

Add:

  • Add stream management test cases;
  • Add link on API ref. in Readme.md.

Fixed:

  • Fix TypeError: Cannot read property 'statusCode' of undefined for Node env;
quickblox-javascript-sdk - 2.7.0

Published by Vladlukhanin almost 7 years ago

Added:

QB.chat.getLastUserActivity(userId) - to send query;
QB.chat.onLastUserActivityListener(userId, seconds) - get last user activity;
  • Support WebRTC in Safari 11 (experimental);

Updated:

  • API Reference:
    • QB.addressbook,
    • QB.content,
    • QB.data,
    • QB.pushnotifications,
    • QB.user;
  • possibilty to get user by phone number;

Removed:

  • QB.chat.privacyList.setAsActive();
  • QB.content.taggetForCurrentUser();

Samples:

  • WebRTC sample - Hide record button if MediaRecorder is unavailable.
quickblox-javascript-sdk - 2.6.2

Published by dimaspirit about 7 years ago

Added:

  • Added ignores for npm (.npmignore file);

Imporvements:

  • Data sample improvements;

Fixed:

  • Fixed XML stanza for send message with attachments in nodejs environment;
  • Fixed file's size for response from QB.content.createAndUpload(file, callback);

Removed:

  • Remove some samples (content, custom object);
quickblox-javascript-sdk - 2.6.1

Published by dimaspirit about 7 years ago

Deprecated:

  • QB.chat.privacylist.setAsActive() is deprecated;

Fixed:

Improvement:

  • Add work with media in Data sample;
quickblox-javascript-sdk - 2.6.0

Published by dimaspirit over 7 years ago

New:

  • new callback onKickOccupant(dialogId, initiatorUserId) to handle a case where User2 joined chat dialog and User1 removed him from occupants;

  • new callbacks onJoinOccupant(dialogId, userId) and onLeaveOccupant(dialogId, userId) to handle group dialog changes;

  • new task npm run buildNotMinified;

  • Karma/Istanbul code coverage tools. To start use the following comand: node node_modules/.bin/karma start karma.conf.js. To see a report look at subdirectory coverage in the default location.
    Warning! Before run you need to rebuild sdk with buildNotMinified task;

Updated:

  • refactored API logs format;

Fixed:

  • ability to use multiple QB instances;
  • onMessageErrorListener does not work under (Node.js);
  • QB.chat.privacylist.delete method does not work (Node.js);
  • an issue with recursion when do QB.chat.disconnect inside QB.chat.connect's callback (Node.js);
  • QB.users.resetPassword always returns an error;
  • QB.chat.privacylist.update method does not work properly when change deny-> allow;
  • methods to decline the use of active/privacy lists (QB.chat.privacylist.setAsDefault('', callback) and QB.chat.privacylist.setAsActive('', callback)) does not work properly. Also, now you can pass null instead of empty string '' to decline;
  • QB.chat.privacylist.getNames method does not return anything if a user does not have any active/default lists;
  • QB.chat.privacylist.getNames returns all names except active/default at names key under Node.js. Made it similar to browser env behaviour;
  • QB.chat.muc.listOnlineUsers method not returns an array of integers instead of array of strings.
  • Event handlers to be registered with Strophe multiple times ( thanks @ruffin-- );
quickblox-javascript-sdk - 2.5.5

Published by dimaspirit over 7 years ago

New:

  • new callback onKickOccupant(dialogId, initiatorUserId) to handle a case where User2 joined chat dialog and User1 removed him from occupants;

  • new callbacks onJoinOccupant(dialogId, userId) and onLeaveOccupant(dialogId, userId) to handle group dialog changes;

  • new task npm run buildNotMinified;

  • Karma/Istanbul code coverage tools. To start use the following comand: node node_modules/.bin/karma start karma.conf.js. To see a report look at subdirectory coverage in the default location.
    Warning! Before run you need to rebuild sdk with buildNotMinified task;

Updated:

  • refactored API logs format;

Fixed:

  • ability to use multiple QB instances;
  • onMessageErrorListener does not work under (Node.js);
  • QB.chat.privacylist.delete method does not work (Node.js);
  • an issue with recursion when do QB.chat.disconnect inside QB.chat.connect's callback (Node.js);
  • QB.users.resetPassword always returns an error;
  • QB.chat.privacylist.update method does not work properly when change deny-> allow;
  • methods to decline the use of active/privacy lists (QB.chat.privacylist.setAsDefault('', callback) and QB.chat.privacylist.setAsActive('', callback)) does not work properly. Also, now you can pass null instead of empty string '' to decline;
  • QB.chat.privacylist.getNames method does not return anything if a user does not have any active/default lists;
  • QB.chat.privacylist.getNames returns all names except active/default at names key under Node.js. Made it similar to browser env behaviour;
  • QB.chat.muc.listOnlineUsers method not returns an array of integers instead of array of strings.
  • Event handlers to be registered with Strophe multiple times ( thanks @ruffin-- );
quickblox-javascript-sdk - 2.5.4

Published by dimaspirit over 7 years ago

Remove:

  • qbLocation Module (Use Custom Object);

New:

  • chat sample;

Fixed:

  • can't login into sample video chat (test and dev) with 1 login name;
  • can't reconnect after voluntary disconnect before;
  • QB.chat.onContactListListener doesn't fire;
quickblox-javascript-sdk - 2.5.3

Published by dimaspirit over 7 years ago

Patch with minified quickblox.min.js;
Nothing changed;

quickblox-javascript-sdk - 2.5.2

Published by dimaspirit over 7 years ago

New:

  • Added a webrtc-adapter as dependency;
  • Added new property to params for QB.chat.connect();
    If you don't want to get list of users (roster) pass connectWithoutGettingRoster to QB.chat.connect();
  // @example
  QB.chat.connect({
    userId: user.id, 
    password: user.pass,
    connectWithoutGettingRoster: true
  }, function(err) {});

Fixed:

  • Broken any chat functionality after lost a connection;

Samples:

  • Rewrite a sample of chat. Old version doesn't support and will be removed in next release;
quickblox-javascript-sdk - 2.5.1

Published by dimaspirit almost 8 years ago

New:

  • Added a button 'Audio call' to webrtc sample (separeted audio / video call );
  • Added a codeclimate service (see a badge in README.md);

Update:

  • Stream management isn't supported by BOSH protocol. Added an exception;

Remove / Deprecated:

  • qbLocation is deprecated;
  • QB.chat.addListener is deprecated;
  • webrtcSession.filter/webrtcSession.snapshot is removed;

Fixed:

  • WebRTC sample (Sometimes user doesn't get incoming call, initiator doesn't get incoming calls when caller clicked 'End call' button when outgoing call is started once, doesn't get any incoming call from any caller if callee rejected incoming group call before).
quickblox-javascript-sdk - 2.5.0

Published by dimaspirit almost 8 years ago

New:

Updated:

quickblox-javascript-sdk - 2.4.0

Published by dimaspirit almost 8 years ago

Features:

  • New build tool (Gulp instead of Grunt).
  • Chat Stream Management. This feature defines an approach for ensuring that message was delivered to server (aka 'sent' status).
  • Stream recording in video chat. You can record a stream or a few streams by using QB.Recorder. Now QB.Recorder is in beta version, so be careful with this functionality.
  • Removed unminified (quickblox.js) version of library. Uses source maps (npm run develop) for debugging.
quickblox-javascript-sdk - 2.3.4

Published by Vladlukhanin about 8 years ago

Updated:

  • Method for send message and method for send system message return message id.
quickblox-javascript-sdk - 2.3.3

Published by Vladlukhanin about 8 years ago

Updated:

  • SDK can send and receive the body in the system message.
quickblox-javascript-sdk - 2.3.2

Published by Vladlukhanin about 8 years ago

Fixed:

  • removed parseInt() method for the 'id' attribute in attachment.
Package Rankings
Top 6.17% on Npmjs.org
Top 7.75% on Bower.io
Badges
Extracted from project README
Code Climate npm npm