Skip to content

Commit

Permalink
Release 0.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Narek committed Apr 28, 2016
1 parent 725359a commit 5b01678
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 92 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 0.9.7 [2016-04-28]

### Release Notes

This release adds support for new push plugin (phonegap-plugin-push) while keeping the compatibility with the previously supported push plugins.

### Features

- Added support for phonegap-plugin-push
- Added push alerts localizatoin support on iOS. Works with new phonegap-plugin-push only

### Bugfixes

- Fixed the call issue appearing on some Android devices caused by a missing permission
- Fixed issues with Intel XDK Emulator (iOS, Android) and debugging in AppPreview (Android only)
- Fixed camera selection on Android to use the front camera for video calls

## 0.9.6.1 [2016-03-15]

### Release Notes
Expand Down
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Bit6 Cordova Plugin

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:
* [Cordova CLI](http://docs.bit6.com/start/cordova-cli/)
* [Intel XDK](http://docs.bit6.com/start/cordova-xdk/)
* [Telerik App Builder](http://docs.bit6.com/start/cordova-telerik/)

### Prerequisites
* Get the API Key at [Bit6 Dashboard](https://dashboard.bit6.com).

Expand Down Expand Up @@ -51,7 +56,7 @@ var d = b6.startCall('usr:tom', {audio: true, video: true});
```

### Documentation
Bit6 Cordova Plugin exposes the same API as [Bit6 JS SDK](https://github.com/bit6/bit6-js-sdk). Check Bit6 [JS documentation](http://bit6.github.io/bit6-js-sdk/).
Bit6 Cordova Plugin exposes the same API as [Bit6 JS SDK](https://github.com/bit6/bit6-js-sdk). Check Bit6 [JS documentation](http://docs.bit6.com/guides/js/).

### Demo app
The complete source code is available in the [demo repo](https://github.com/bit6/bit6-cordova-demo). Check out the same demo app running with JS SDK at http://demo.bit6.com.
Expand All @@ -67,20 +72,28 @@ 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:

* [Telerik Push Plugin](https://github.com/Telerik-Verified-Plugins/PushNotification) (Recommended)
* [Legacy PhoneGap Push Plugin](https://github.com/phonegap-build/PushPlugin)
* [phonegap-plugin-push](https://github.com/phonegap/phonegap-plugin-push) (recommended)
```sh
# 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](https://github.com/Telerik-Verified-Plugins/PushNotification)
```sh
$ cordova plugin add https://github.com/Telerik-Verified-Plugins/PushNotification
```

* [Legacy PhoneGap Push Plugin](https://github.com/phonegap-build/PushPlugin) If you use cordova-ios 3.x

```bash
cordova plugin add https://github.com/Telerik-Verified-Plugins/PushNotification
```

Then complete platform-specific configuration:

* __iOS APNs__
* __iOS APNs__ ([detailed guide](http://docs.bit6.com/guides/push-apns/))
1. Generate APNS certificate in iTunes Connect.
2. Export it into a p12 file.
3. Add the file to your app in [Bit6 Dashboard](https://dashboard.bit6.com).
* __Android GCM__

* __Android GCM__ ([detailed guide](http://docs.bit6.com/guides/push-gcm/))
1. Get the project number and server key from [Google Dev Console](http://developer.android.com/google/gcm/gs.html).
2. Add project number and server key for your app in [Bit6 Dashboard](https://dashboard.bit6.com).

Expand Down
4 changes: 3 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.bit6.sdk"
version="0.9.6.1">
version="0.9.7">

<name>Bit6</name>
<description>Add voice and video calling, text and media messaging to your app</description>
Expand Down Expand Up @@ -102,6 +102,7 @@
<source-file src="src/ios/Config.h" />
<source-file src="src/ios/SessionDescriptionDelegate.m" />
<source-file src="src/ios/SessionDescriptionDelegate.h" />
<source-file src="src/ios/Base.lproj/Localizable.strings" target-dir="Resources/Base.lproj" />

</platform>
<platform name="android">
Expand All @@ -124,6 +125,7 @@
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"></uses-feature>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down
3 changes: 2 additions & 1 deletion src/android/com/dooble/phonertc/PhoneRTCPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ private static void abortUnless(boolean condition, String msg) {
private VideoCapturer getVideoCapturer() {
// AG: switched camera facing values to test. On my Android
// front camera does not work with this WebRTC version
String[] cameraFacing = { "back", "front" };
//Bit6 change: Switching the order to try front camera first (works ok now).
String[] cameraFacing = { "front", "back" };
int[] cameraIndex = { 0, 1 };
int[] cameraOrientation = { 0, 90, 180, 270 };
for (String facing : cameraFacing) {
Expand Down
31 changes: 31 additions & 0 deletions src/ios/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Localizable.strings
Bit6

Created by Carlos Thurber on 03/09/16.
Copyright © 2016 Bit6. All rights reserved.
*/

// [caller name] is calling
"BX_INCOMING_CALL" = "%@ is calling...";

// Missed call from [caller name]
"BX_MISSED_CALL" = "Missed call from %@";

// [sender]: [message]
"BX_MESSAGE_TEXT" = "%@: %@";

// [sender]: sent a photo
"BX_MESSAGE_PHOTO" = "%@ sent a photo";

// [sender]: sent a video
"BX_MESSAGE_VIDEO" = "%@ sent a video";

// [sender]: sent an audio clip
"BX_MESSAGE_AUDIO" = "%@ sent an audio clip";

// [sender]: sent a location
"BX_MESSAGE_LOCATION" = "%@ sent a location";

// [sender]: sent a file
"BX_MESSAGE_FILE" = "%@ sent a file";
43 changes: 30 additions & 13 deletions www/bit6.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// bit6 - v0.9.6
// bit6 - v0.9.7

(function() {
var slice = [].slice;
Expand Down Expand Up @@ -163,14 +163,14 @@
console.log('ConvId is null', this);
return null;
}
return this.id.replace(/\:/g, '--').replace(/\./g, '_-').replace(/\+/g, '-_');
return bit6.Session.base64urlEncode(this.id);
};

Conversation.fromDomId = function(t) {
if (!t) {
return t;
}
return t.replace(/--/g, ':').replace(/_-/g, '.').replace(/-_/g, '+');
return bit6.Session.base64urlDecode(t);
};

return Conversation;
Expand Down Expand Up @@ -713,7 +713,7 @@

extend(Client, superClass);

Client.version = '0.9.6';
Client.version = '0.9.7';

endpoints = {
prod: 'https://api.bit6.com',
Expand All @@ -722,13 +722,14 @@
};

function Client(opts) {
var hasWebRTC, ref;
var hasWebRTC, ref, ref1, ref2, url;
Client.__super__.constructor.apply(this, arguments);
if ((opts != null ? opts.apikey : void 0) == null) {
throw 'Missing required "apikey" option';
}
this.apikey = opts.apikey;
this.env = (ref = opts.env) != null ? ref : 'prod';
url = (ref = (ref1 = opts.url) != null ? ref1 : opts.env) != null ? ref : 'prod';
this.apiurl = (ref2 = endpoints[url]) != null ? ref2 : url;
hasWebRTC = (window.RTCPeerConnection != null) || (window.mozRTCPeerConnection != null) || (window.webkitRTCPeerConnection != null);
this.caps = {
audio: hasWebRTC,
Expand Down Expand Up @@ -1097,7 +1098,7 @@
id: ident,
role: role
};
return this.api('/groups/' + g.id + '/members', 'POST', memberInfo, (function(_this) {
return this.api('/groups/' + gid + '/members', 'POST', memberInfo, (function(_this) {
return function(err, member) {
if (err) {
return cb(err);
Expand Down Expand Up @@ -1417,6 +1418,7 @@
switch (r[0]) {
case 'usr':
case 'pstn':
case 'mailto':
t = r[1];
break;
case 'grp':
Expand Down Expand Up @@ -1646,7 +1648,7 @@
data = {};
}
m = m.toLowerCase();
url = endpoints[this.env] + path;
url = this.apiurl + path;
url += path.indexOf('?') < 0 ? '?' : '&';
url += 'apikey=' + this.apikey;
if (m !== 'post') {
Expand All @@ -1660,7 +1662,7 @@
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
var error, ex, r;
var error, ex, isXhrOk, r;
if (xhr.readyState === 4) {
r = null;
try {
Expand All @@ -1686,7 +1688,8 @@
}
return;
}
if (xhr.status === 200 && r.status >= 200 && r.status < 300) {
isXhrOk = xhr.status === 200 || xhr.status === 0;
if (isXhrOk && r.status >= 200 && r.status < 300) {
return typeof cb === "function" ? cb(null, r.response, r.headers) : void 0;
} else {
return typeof cb === "function" ? cb(r.response, null, r.headers) : void 0;
Expand Down Expand Up @@ -1995,14 +1998,14 @@
this.client = client;
Outgoing.__super__.constructor.apply(this, arguments);
this.id = bit6.JsonRpc.generateGUID();
this.me = this.client.session.identity;
this.created = this.updated = Date.now();
this.flags = bit6.Message.TEXT | bit6.Message.SENDING;
this.from(this.client.session.identity, this.client.session.displayName);
}

Outgoing.prototype._export = function() {
var i, k, len, n, x;
n = ['id', 'flags', 'me', 'other', 'content', 'data'];
n = ['id', 'flags', 'me', 'from_name', 'other', 'content', 'data'];
x = {};
for (i = 0, len = n.length; i < len; i++) {
k = n[i];
Expand All @@ -2022,6 +2025,14 @@
return this;
};

Outgoing.prototype.from = function(from, name) {
this.me = from;
if (name) {
this.from_name = name;
}
return this;
};

Outgoing.prototype.text = function(text) {
this.content = text;
return this;
Expand Down Expand Up @@ -3278,7 +3289,7 @@
bit6.Session = (function(superClass) {
extend(Session, superClass);

Session.prototype._sprops = ['authenticated', 'authInfo', 'config', 'device', 'identity', 'token', 'userid'];
Session.prototype._sprops = ['authenticated', 'authInfo', 'config', 'device', 'identity', 'displayName', 'token', 'userid'];

function Session(client) {
this.client = client;
Expand Down Expand Up @@ -3450,6 +3461,12 @@
return (ref = this.client)._api.apply(ref, ['/auth/1' + path].concat(slice.call(params), [cb]));
};

Session.base64urlEncode = function(s) {
s = btoa(s);
s = s.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
return s;
};

Session.base64urlDecode = function(s) {
s += new Array(4 - ((s.length + 3) & 3)).join('=');
s = s.replace(/\-/g, '+').replace(/_/g, '/');
Expand Down
Loading

0 comments on commit 5b01678

Please sign in to comment.