This document contains only major functionality changes in certain versions. Minor fixes/updates are omitted.
- SDK will not add
/restapi/v1.0
to URLs - SDK was separated into 2 packages:
@ringcentral/sdk
and@ringcentral/subscriptions
appKey
andappSecret
were replaced withclientId
andclientSecret
- Async implementation of
Storage
- Platform method
createUrl('xxx', {addToken: true})
has been extracted as separate async methodsignUrl('xxx')
ApiResponse
class was removed, all methods return plainResponse
which can be worked on usingClient
- Bower was discontinued
- SDK no longer runs refresh queue across multiple tabs
- SDK is no longer shipped with the bundle, you need to add polyfills and PUBNUB manually
- Migration Guides merged into one Change Log
SDK.core.Observable
has been replaced by NodeJS'sEventEmitter
and is accessible viaSDK.core.EventEmitter
Platform.login
does not supportremember
parameter anymore, if you wish to supply custom token TTLs, useaccessTokenTtl
andrefreshTokenTtl
Subscription
will not throw an error when it can't renew because it's expired when timeout hits (computer woke up after sleep, for example), it will automaticallysubscribe
again with the sameeventFilter
s- Removed
CachedSubscription
queue-related methods Cache.setPrefix
has been removed, prefix cannot be changed, create a new instance of SDK with new prefix insteadSDK.*.*
classes are no longer exposed, use appropriate constructor options to alter defaults
- Helpers were moved to separate repository: RingCentral JS Helpers.
- Root JS name has changed from
RCSDK
toRingCentral.SDK
- New naming convention:
getSomething()
methods are now simplysomething()
Auth
class insidePlatform
AjaxObserver
functionality been moved toClient
- New
ApiResponse
interface that wraps native Requests/Responses:apiResponse.json()
instead ofajax.json
apiResponse.multipart()
instead ofajax.responses
apiResponse.request()
andajax.response()
to access to DOM Request and DOM Response accordinglyapiResponse.request().headers
andajax.response().headers
should be used to access headers
Subscription
interface changes
- AJAX object is now represented by 2 separate objects:
Request
Response
- AJAX error has 2 properties:
e.request
ande.response
and backward-compatiblee.ajax
which is equal toe.response
. - AJAX Response now has
responses
property andjson
property along with backward-compatibledata
property
The key differences between versions:
- Promises/A+
- Native ECMAScript6 where available (Chrome, FireFox, Safari)
- RSVP polyfill for older browsers
- RCSDK is now a constructor
- Instance has a context, so it is possible to have multiple simultaneous connections to API
- All other objects are obtained through RCSDK instance's getters instead of static methods of classes
Before:
var platform = RCSDK.core.Platform.getInstance();
After:
var rcsdk = new RCSDK(), // save this object, everything else is provided by it
platform = rcsdk.getPlatform();
Before:
platform.apiCall({
url: '...',
success: function(data){ ... }
error: function(e){ ... }
});
After:
platform.apiCall({url: '...'}).then(function(ajax){
// do something with ajax.data
}).catch(function(e){ ... });
This also applies to any other place that formerly accepted success
and error
callbacks.
- platform.isAuthorized|refresh|authorize|logout
- subscription.register|subscribe|renew|remove
Before:
RCSDK.core.Ajax.observer.on(...)
After:
rcsdk.getAjaxObserver().on(...);
Call Monitoring object is now replaced with a number of Helper objects, which gives developers more control over application logic while processing logic is still maintained by SDK.
Take a look on Call Management Using JavaScript section of Usage Manual, and big AngularJS Demo for implementation examples.