We’ve released a newer version of our HTML5/JS SDK for AppWarp Multiplayer gaming platform. The new SDK involves some major changes.
One of the major changes is the support for Typescript. Typescript makes writing class-based object oriented JavaScript programs easy. As part of the SDK, you will also get the corresponding appwarp.d.ts file which you can use while working with TypeScript.
Another major change is the way the listeners are defined and used. Now instead of objects, function callbacks are used to listen to the events. Simply define listeners and register them with their corresponding event Id.
function onConnectDone(res)
{
}
function onChatReceived(chat)
{
}
var _warpclient;
AppWarp.WarpClient.initialize(apiKey, secreteKey);
_warpclient = AppWarp.WarpClient.getInstance();
_warpclient.setResponseListener(AppWarp.Events.onConnectDone, onConnectDone);
_warpclient.setNotifyListener(AppWarp.Events.onChatReceived, onChatReceived);
To play with our new SDK, we have created a basic chat application which you can launch by clicking here. The full tutorial with source code is available here.
Another major change is the introduction of AppWarp namespace. All the functions, constants and classes are defined inside ‘AppWarp’ Namespace. The WarpClient is now a singleton class, so you must use getInstance() to get the instance.
var _warpclient;
AppWarp.WarpClient.initialize(apiKey, secreteKey);
_warpclient = AppWarp.WarpClient.getInstance();
All the events i.e. responses and notifications are declared under ‘AppWarp.Events’ namespace.
To learn more about AppWarp SDK visit the HTML5 Dev Center, and you can send us your queries at support@shephertz.com
Leave A Reply