ApiRTC on Cordova, ApiRTC

Без кейворда

Add real-time communication into your application lightly !

ApiRTC on Cordova

Our tutorial will guide you through the steps of developing and implementing our ApiRTC Basic Call feature on an Android and/or iOS device.

But if you want to skip to the code, clone our repo right here on Github

Apache Cordova is an open-source mobile development framework.

By using Cordova and our ApiRTC technology, you will be able to develop cross-platform applications even on iOS devices.

Due to Apple’s confinements regarding webRTC technologies, all iOS users will have to develop a native app through Cordova to implement ApiRTC solutions on iOS devices. As you will see later on in this tutorial, some extra plugins will be required to permit total webRTC compliance.

On with the project!

1. Environment and requirements:

The last step of setting your environment will be to install Cordova:

Two. Cordova project

Now let’s create a brand-new Cordova project and upload our ApiRTC basic call feature on both platforms:

If the same HTML5 application is to be used for both platforms, consider using a single Cordova project. Since the iosrtc plugin only affects iOS, and the crosswalk plugin only affects Android, there is no conflict having both in the same project.

Two.1 Make it work: required plugins

iosRTC plugin: requires iOS nine or greater.

Crosswalk plugin: requires Android Four.Four or greater.

If you are developing for only one platform, scroll down to see what plugins you need.

If you are developing for both platforms, just copy-paste these directives:

We need to add this plugin :

The crosswalk-webview plugin is needed for Android versions older than Five.0. The other two plugins are now required to conform with fresh Android permissions checking mechanism.

Add the index.html

Edit the index.html file in your “www” folder:

Building the app

Now that you’re all set, how about building the app?

Open this link with Chrome to exchange with your mobile over webrtc.

You will be able to establish a webRTC call inbetween your app and your computer using the number that has been automatically assigned to your apiRTC Client.

Troubleshooting

Getting building errors? Have some questions? Check out our FAQ to find the response to your problem.

Related video:

Leave a Reply