Installation
Install and configure Android UI SDK
Step 1: Setup your account on Channelize dashboard
You need to setup an account to https://channelize.io and post that you'll get the "Public Key" which is required to access the Channelize API SDK (As mentioned in API SDK documentation).
Step 2: Install the SDK
To install the UI SDK using Gradle, add the following lines to a build.gradle file at the app level.
build.gradle
dependencies {
implementation 'com.github.ChannelizeIO.Channelize-Android-SDK:channelizeui:4.1.6'
}
Add below code at project level build.gradle file:
buildscript {
repositories {
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.0.0'
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
url "https://giphy.bintray.com/giphy-sdk"
}
}
}
Step 3: Add permissions and other info in AndroidManifest.xml
Head over to AndroidManifest.xml and add the following:
If you want to use all features of UI SDK then add below permissions into your main app:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
NOTE: Add all the meta-data inside <application>
tag.
Add Giphy API_KEY: If you want to use Sticker/Gif feature in UI SDK then you've to add the Giphy API KEY inside your AndroidManifest.xml file. Replace the "API_KEY" in value with your Giphy API KEY that you'll get after registering an account on Giphy Website
<meta-data android:name="com.channelize.giphy.API_KEY"
android:value="API_KEY" />
Add Google Places API_KEY: If you want to use the location feature in UI SDK then you've to add the Google Places API KEY inside your AndroidManifest.xml file. Replace the "API_KEY" in value with your Google Places API KEY.
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="API_KEY" />
Add PUSH_NOTIFICATION_ICON that you want to show as small icon on push notifications:
<meta-data android:name="com.channelize.messenger.notification.smallIcon"
android:resource="@drawable/PUSH_NOTIFICATION_ICON" />
Add COMPLETE_PACKAGE_PATH_OF_ACTIVITY that you want to launch if user click on push notification if you want to launch Channelize home screen than put the value @string/pm_push_notification_open_activity_name.
<meta-data android:name="com.channelize.messenger.activity.open.notification"
android:value="COMPLETE_PACKAGE_PATH_OF_ACTIVITY" />