📜 ⬆️ ⬇️

New version of mobile SDK VoxImplant with support for WebRTC, P2P, video calls for iOS and Android

In the modern world, mobile devices have become more popular than PCs and have long overtaken them in sales. We did the first version of the mobile SDK for VoxImplant using our previous developments, namely the SDK for Zingaya, but the requirements and functionality of VoxImplant are much broader, so we had no choice but to make a new version of the SDK. This version received full WebRTC support, which allowed us to give developers full Web SDK functionality, including video calls, peer-to-peer, and other useful features. Learn more about creating a new version of the SDK and new features under the cat.

Small preface


Let's start with the fact that the SDK is designed to work with the VoxImplant platform, therefore, in addition to the SDK itself, you also need to register a VoxImplant developer account, create an application, call processing script, application users, etc. - it all depends on what kind of application you are doing. In the archive with the SDK there is a demo app (softphone) that will work with that account and application, which will be indicated to him at login, you can safely use the video chat described by us earlier , instead of the web application and Web SDK you will use the demo -application and mobile SDK respectively.

iOS SDK


Building WebRTC under iOS took some time, attempts to turn on optimizations to increase performance eventually ended in success, and the SDK began to work quite well even on non-newer and high-end devices, for example, on iPad 2 both audio and video worked perfectly. We compiled the SDK right under iOS 8, as Apple will not miss applications in other versions, even in Appstore. Even at the time when working on the Zingaya application, we found out that iOS developers love to use CocoaPods and this greatly simplifies their life, so at the same time we wrote down the VoxImplantSDK Pod . In the archive with the SDK there is a demo application. Let's use his example and consider using the SDK. Since we made a pod, we can use it:
')
  1. We download archive with SDK and demo application from here
  2. Unpack and delete the extra folder VoxImplantSDKiOS, it will not be needed, since we will use CocoaPods
  3. Install CocoaPods if you haven't installed it yet (see guides.cocoapods.org/using/getting-started.html#getting-started )
  4. We open the terminal, and
    $ cd 
    to your project directory
  5. Create a Podfile. This is done using
     $ touch Podfile 
  6. Open the created Podfile. The first line should indicate the platform and version.
     platform :ios, '8.0' 
  7. Add a string
     pod 'VoxImplantSDK' 
  8. Save the Podfile
  9. Run
     $ pod install 
  10. Open the created * .xcworkspace
  11. In the project in the folder Frameworks delete
     libVoxImplantSDK.a 
    in this case it is superfluous
  12. We build and run a demo application

If everything is ok, then the application should start, which will ask you to enter the application user name, password, VoxImplant application name, and VoxImplant account name. If you set up a VoxImplant account (create an application, script, rules and users) in accordance with the article about p2p video chat , then you can safely log in and make p2p audio / video calls between users of the application (ios sdk <-> ios sdk, web sdk < -> ios sdk, ios sdk <-> android sdk, etc.). The main thing is not to forget that the video camera is not available on the iPhone / iPad emulator. Nobody restricts the use of the SDK only for p2p audio / video calls, you can also make calls to regular numbers, to SIP, use the SDK as a client to IP PBX, call center, etc., scripts are true just like from web sdk. all these cases will require others.

Android SDK


In the case of Android, the process of creating an SDK in general was similar to the process of creating for iOS, but it was somewhat simpler, since WebRTC is built into Chrome on Android and is constantly maintained in a working and up-to-date state. For example, one of the latest builds introduced hardware support for the H.264 codec, but we are not using it yet, as there are a number of nuances. In the near future we should expect the appearance of H.264 support for WebRTC in Firefox, and maybe in Chrome, since the WebRTC working group announced that both codecs (VP8 and H.264) are mandatory to implement for browser vendors. While some doubts about Chrome and IE (where they implement ORTC and H.264) are tormenting, but only time will tell. Firefox is still in an advantageous position, announcing support for both codecs (not without Cisco assistance). The SDK for iOS and Android are functionally identical, so let's move on to the demo application for Android:

  1. If you have not yet installed ADT, you can get it here.
  2. Download the archive from the SDK from here http://voximplant.com/docs/references/mobilesdk/android/
  3. Unpack and run ADT
  4. We import the project from the folder, which turned out after unpacking the archive with the SDK
  5. Build and run the demo project

If everything is good, then an application will start that has the functionality similar to the demo application on iOS, only more control buttons (in the iOS version, not everyone brought everything out).


In this application, the username must be entered the entire name of the user_user_application@applement_name.account_name.voximplant.com, after connection and authorization, you can call (if you have already configured your VoxImplant account). The minimum Android version with which the new SDK will work is 4.1+ (API level 16).

In general, this is all, we will be grateful to you for feedback, if you find any problems in the work of the SDK and if you tell us on Habré what applications you managed to make on the basis of our platform. We decided that up to 1000 users can use peer-to-peer audio and video calls for free. Future plans include adding IM / presence, packaging SDK for Appcelerator, PhoneGap, Parse, H.264 support.

Source: https://habr.com/ru/post/253041/


All Articles