{"id":5820,"date":"2022-02-07T13:02:25","date_gmt":"2022-02-07T05:02:25","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=5820"},"modified":"2025-04-10T20:17:44","modified_gmt":"2025-04-10T12:17:44","slug":"how-to-use","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/cordova-toolkit\/how-to-use\/","title":{"rendered":"How to use\u00a0Cordova Plugin"},"content":{"rendered":"\n<h3><strong>Creating a New Application using Cordova Plugin<\/strong><\/h3>\n\n\n\n<ul><li>Create a new application<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cordova create SampleApp com.example.sampleapp videoconferencing<\/pre>\n\n\n\n<ul><li>Add Platform<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cordova platform add ios cordova platform add android<\/pre>\n\n\n\n<ul><li>Add the Plugin into your Project<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cordova plugin add cordova-plugin<\/pre>\n\n\n\n<ul><li><strong>Set up Cordova\/Ionic application on Android<\/strong> <strong>using the following steps:<\/strong><\/li><\/ul>\n\n\n\n<ul><li><strong>Step 1:<\/strong> Go inside the Cordova project and open the Android&nbsp;folder<\/li><\/ul>\n\n\n\n<p>If the Android platform already added, remove Android and add again using the below command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ionic&nbsp;cordova&nbsp;platform rm android &amp;&amp; ionic&nbsp;cordova&nbsp;platform add android&nbsp;<\/pre>\n\n\n\n<ul><li><strong>Step 2:<\/strong> Set the Minimum SDK version and desugaring in&nbsp;gradle.properties&nbsp;file as shown:&nbsp;<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">android.useAndroidX=true&nbsp;\nandroid.enableJetifier=true&nbsp;\ncdvMinSdkVersion=21&nbsp;\nandroid.enableDexingArtifactTransform.desugaring=false&nbsp;<\/pre>\n\n\n\n<ul><li><strong>Step 3:<\/strong> Add the required libraries like&nbsp;webrtc&nbsp;and socket in the project. properties file as shown:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cordova.system.library.8=io.socket:socket.io-client:2.1.2<\/pre>\n\n\n\n<ul><li><strong>Step 4:<\/strong> If you face a \u201cmerge debug resource failed\u201d error, then add\u00a0packagingOptions\u00a0in the app-level\u00a0<code>build.gradle<\/code>\u00a0file in android block\u00a0<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>Execution failed for task ':app:mergeDebugJavaResource'. \n\n&gt; A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade \n\n   &gt; More than one file was found with OS independent path 'META-INF\/DEPENDENCIES'. <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">packagingOptions&nbsp;{&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclude 'META-INF\/DEPENDENCIES'&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclude 'META-INF\/LICENSE'&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclude 'META-INF\/LICENSE.txt'&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclude 'META-INF\/license.txt'&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclude 'META-INF\/NOTICE'&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclude 'META-INF\/NOTICE.txt'&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclude 'META-INF\/notice.txt'&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclude 'META-INF\/ASL2.0'&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclude(\"META-INF\/*.kotlin_module\")&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;<\/pre>\n\n\n\n<ul><li><strong>Set up Cordova\/Ionic on iOS using the following steps:<\/strong><\/li><li><strong>Step 1:<\/strong> Add&nbsp;iOS project&nbsp;<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">ionic&nbsp;cordova&nbsp;platform add&nbsp;ios\/&nbsp;cordova&nbsp;platform add&nbsp;ios&nbsp;<\/pre>\n\n\n\n<p>This&nbsp;installs&nbsp;all dependency&nbsp;of the portly libraries&nbsp;through Pod.&nbsp;&nbsp;<\/p>\n\n\n\n<ul><li><strong>Step 2:<\/strong> Go&nbsp;to your iOS project folder and open&nbsp;xcode.&nbsp;<\/li><li><strong>Step 3:<\/strong> Set up your certificate.&nbsp;&nbsp;<\/li><li><strong>Step 4:<\/strong> Build the app either&nbsp;through&nbsp;command line or through&nbsp;xcode.<\/li><\/ul>\n\n\n\n<ul><li>Build application<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cordova build<\/pre>\n\n\n\n<ul><li>Run the application<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cordova run ios\ncordova run android<\/pre>\n\n\n\n<div style=\"height:23px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:23px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3><strong>Try the Sample Application demonstrating Cordova Plugin<\/strong><\/h3>\n\n\n\n<ul><li>Clone or download Repository for <a href=\"https:\/\/github.com\/smartflomeet\/One-to-One-Video-Chat-Sample-Cordova-Application\" target=\"_blank\" rel=\"noreferrer noopener\">Demo Application<\/a><\/li><li>Go to the terminal and change your directory to the root of the sample project that you want to run.<\/li><li>Install the required node modules<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install<\/pre>\n\n\n\n<ul><li>Add required Platforms (Android or iOS)<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cordova platform add iOS \/\/add iOS to your project\ncordova platform add android \/\/add android to your project<\/pre>\n\n\n\n<ul><li>Configure the following variables before running the application<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">var userName = \"USERNAME\"; \/* HTTP Basic Auth Username of App Server<em> *\/<\/em>\n<em>var password = \"PASSWORD\"; \/*<\/em> HTTP Basic Auth Password of App Server *<em>\/<\/em>\n<em>var kBaseURL = \"FQDN\" \/<\/em>* FQDN of App Server URL *\/<\/pre>\n\n\n\n<ul><li><strong>For Android only: <\/strong>Enable Multidex<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cordova plugin add cordova-plugin-enable-multidex<\/pre>\n\n\n\n<ul><li>Run the application<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cordova run ios \/\/ to run iOS project\ncordova run android \/\/ to run Android project<\/pre>\n\n\n\n<div style=\"height:23px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:23px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Device Permission<\/h3>\n\n\n\n<p><strong>Setup for iOS<\/strong><\/p>\n\n\n\n<p>Open the <em><code>info.plist<\/code><\/em> and add:<\/p>\n\n\n\n<ul><li><strong>Privacy <\/strong>&#8211; Microphone Usage description and add a note in the Value column.<\/li><li><strong>Privacy <\/strong>&#8211; Camera Usage description and add a note in the Value column.<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<a name=\"error-exceptions\"><\/a>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Error &amp; Exceptions<\/h2>\n\n\n\n<p>Cordova SDK method call might face exception cases and fail. In such cases a JSON is returned through Callback. Example of JSON Object given below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{\n\t\"errorCode\": Number,\n\t\"msg\": \"String\",\n\t\"desc\": \"String\"\n}<\/pre>\n\n\n\n<ul><li><code>errorCode<\/code>\u2013 Number. Error Code.<\/li><li><code>msg<\/code>&nbsp;\u2013 String. Error Message.<\/li><li><code>desc<\/code>&nbsp;\u2013 String. Optional. Descriptive explanation of the error.<\/li><\/ul>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\"><\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-center\"><a href=\"..\/\">Index<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-right\"><a href=\"..\/get-devices\/\">Get Media Device Access<\/a> \u2192<a href=\"\/developer\/how-to-use\/\"><\/a><\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a New Application using Cordova Plugin Create a new application cordova create SampleApp com.example.sampleapp videoconferencing Add Platform cordova platform add ios cordova platform add android Add the Plugin into your Project cordova plugin add cordova-plugin Set up Cordova\/Ionic application on Android using the following steps: Step 1: Go inside the Cordova project and open the Android&nbsp;folder If the Android platform already added, remove Android and add again using the&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3719,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"featured":false,"featured-large":false},"uagb_author_info":{"display_name":"vcxdevwpadmin","author_link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/author\/vcxdevwpadmin\/"},"uagb_comment_info":0,"uagb_excerpt":"Creating a New Application using Cordova Plugin Create a new application cordova create SampleApp com.example.sampleapp videoconferencing Add Platform cordova platform add ios cordova platform add android Add the Plugin into your Project cordova plugin add cordova-plugin Set up Cordova\/Ionic application on Android using the following steps: Step 1: Go inside the Cordova project and open&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/5820"}],"collection":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/comments?post=5820"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/5820\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3719"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=5820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}