CometChat SDK v1.6 now offers support for app development in Cordova. You can use Ready UI APIs using our Cordova plugin.
Prerequisite
You will find the Cordova SDK plugin inside the “Cordova” directory of the SDK you download.
cordova create <DIRECTORY_NAME> <APP BUNDLE ID> <APP NAME>
e.g cordova create testapp com.testapp.app HelloWorld
cd testapp
cordova platform add android
cordova plugin add <PATH TO SDK_PLUGIN FOLDER>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.VIBRATE" />
dexOptions {
incremental true
javaMaxHeapSize "2048M"
}
Add following lines in dependencies { section:
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.google.code.gson:gson:2.3'
compile 'com.google.firebase:firebase-messaging:9.0.0'
compile 'com.mcxiaoke.volley:library:1.0.17'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.clans:fab:1.6.2'
compile 'org.jsoup:jsoup:1.8.1'
compile 'org.apache.httpcomponents:httpcore:4.3.2'
compile 'org.apache.httpcomponents:httpmime:4.3.3'
compile 'com.parse.bolts:bolts-tasks:1.4.0'
compile 'com.commit451:PhotoView:1.2.4'
compile 'com.android.support:multidex:1.0.0'
compile 'com.splitwise:tokenautocomplete:1.3.3'
compile 'com.tubb.smrv:swipemenu-recyclerview:5.2.1'
compile 'com.github.bumptech.glide:glide:3.5.2'
compile 'se.emilsjolander:stickylistheaders:2.7.0'
Add following lines after at the end of android { section
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
Include Readyui.js and Customui.js in your index.html file to access Ready UI functionality in your Cordova app
Not finding what you need?
The CometChat team is here to help!