Telerik-Verified-Plugins / Bit6

Bit6 Cordova Plugin - add rich messaging and WebRTC voice/video calling to iOS and Android apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bit6 Cordova Plugin

GitHub version

Add voice/video calling, texting, and rich media messaging into any mobile or web application.

Get Bit6 sample app running in 10 minutes - follow our Quick Start guides for:

Prerequisites

Installation

$ cordova plugin add https://github.com/bit6/bit6-cordova

Configuration

Initialize Bit6 Plugin with your API key.

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
  var opts = {'apikey': 'yourApiKey'};
  var b6 = Bit6.init(opts);
  // Bit6 SDK has been initialized
}

Video/Voice calls on iOS

To enable call support on iOS add iosrtc plugin

cordova plugin add cordova-plugin-iosrtc

Note: Check the plugin requirements on this page and building page

Note: no need to add iosrtc if your app does not use audio/video calls.

Video/Voice calls on Android < 5

To enable call support on Android < 5 add Crosswalk Webview plugin

cordova plugin add cordova-plugin-crosswalk-webview

Real time notifications on Android<4.4

For real time notifications (websocket) on Android<4.4 Crosswalk Webview is required.

Permissions on Android >= 6

For call support on Android >= 6 grant Camera and Microphone permissions from Settings->Apps->YourApp->Permissions.

Storage permission is required to support message attachments.

Quickstart

Create a user with a password authentication:

b6.session.signup({identity: 'usr:john', password: 'secret'}, function(err) {
  if (err) {
    console.log('login error', err);
  } else {
    console.log('login successful');
  }
});

Send a message to another user:

b6.compose('usr:tom').text('Hello!').send(function(err) {
  if (err) {
    console.log('error', err);
  } else {
    console.log('message sent');
  }
});

Make a video call:

// Start an outgoing call and get a call controller (Dialog)
var d = b6.startCall('usr:tom', {audio: true, video: true});

Documentation

Bit6 Cordova Plugin exposes the same API as Bit6 JS SDK. Check Bit6 JS documentation.

Demo app

The complete source code is available in the demo repo. Check out the same demo app running with JS SDK at http://demo.bit6.com.

Supported platforms

  • iOS
  • Android
  • Browser

Push notifications

Push Notification support is required for receiving incoming calls and messages.

To enable this functionality please add one of these push plugins to your project:

  • phonegap-plugin-push (recommended)

    # Set any value for SENDER_ID. Bit6 plugin will override it with the correct one.
    $ cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
  • Telerik Push Plugin

    $ cordova plugin add https://github.com/Telerik-Verified-Plugins/PushNotification
  • Legacy PhoneGap Push Plugin If you use cordova-ios 3.x

Then complete platform-specific configuration:

Building with Xcode 7

Please disable Bitcode support when building your Cordova app with Xcode. Go to Build Settings, set Enable Bitcode to No.

Third-party libraries

Bit6 plugin leverages code from the excellent WebRTC, PhoneRTC and phonegap-websocket projects.

About

Bit6 Cordova Plugin - add rich messaging and WebRTC voice/video calling to iOS and Android apps


Languages

Language:JavaScript 99.0%Language:Objective-C 1.0%