Introduction



Tagove for Android supports API 21 and above.



Requirements


  • Android Studio 2.2.x

  • Gradle 2.2.x

  • Android 7.1.1 SDK

  • Android device running Android 5.0 or newer (To get fully functioning sdk)




Installation Instructions



Steps to Install Tagove with all required dependencies


Add the following dependency to your app's build.gradle file:

//  Add in app's build.gradle file:
dependencies {
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile('io.socket:socket.io-client:1.0.0') {
        exclude group: 'org.json', module: 'json'
    }
    compile 'com.android.support:multidex:1.0.2'
    compile 'com.android.support:design:26.1.0'
    compile 'com.mikhaellopez:circularimageview:2.1.1'
    compile 'andhradroid.dev:aFilechooser:1.0.1'
    compile 'com.tagove.sdk:core:1.+'
}

For our sdk you will need to add these lines to your project's build.gradle.

// Add these lines to your project gradle:

allprojects {
    repositories {
        maven {
            url "http://107.155.116.28:8086/artifactory/libs-release-local"

        }
    }
}
}









//  Add in app's build.gradle file:
dependencies {
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile('io.socket:socket.io-client:1.0.0') {
        exclude group: 'org.json', module: 'json'
    }
    compile 'com.android.support:multidex:1.0.2'
    compile 'com.android.support:design:26.1.0'
    compile 'com.mikhaellopez:circularimageview:2.1.1'
    compile 'andhradroid.dev:aFilechooser:1.0.1'
    compile 'com.tagove.sdk:core:1.+'
}



// Add these lines to your project gradle:

allprojects {
    repositories {
        maven {
            url "http://107.155.116.28:8086/artifactory/libs-release-local"

        }
    }
}
}

Setup and Configuration


  • Our installation guide contains full setup and initialisation instructions

  • The configuration guide provides info on how to configure Tagove for Android.

  • Please contact us on Tagove with any questions you may have, we're only a message away!




Steps to initialize sdk


There are two ways to initialize sdk

  1. With default Tagove server url : You just need to call this method when you want to start chat :

    • TagoveApp.init(MainActivity.this,/Your Account Id Here/, true); like Floating button for support. if you start sdk with TagoveApp.init(MainActivity.this,/Your Account Id Here/, false); then it will start socket connection in background and will not open chat window.

  2. With custom socket url : TagoveApp.initWithServer(this,/Custom Socket URL here/,/Your Account Id Here/);

In both above methods you will get TagoveApp's Instance in return so you can make other operations using it. Or you will get Instance by calling TagoveApp.getInstance() For methods look Helper Methods.

  • Whenever you want to show video chat window floating on the screen you need to extend that Activity class to sdk's BaseActivity.

  • To get our sdk's custom callbacks you need to implement ServerBackendSocket.onSessionEvents to the activity. If the target activity/fragment is different from where the sdk initialized then you need to set the listening object with method TagoveApp.setSessionListner(this); to get callbacks to anywhere you require.


API Explore


Here are the sdk methods to customize events and set features as per your need.

  1. init(AppCompatActivity, accountID, initiateChat):
    @param activity: AppCompatActivity - Pass Activity instance
    @param accountID: String - Id of the account
    @param initiateChat: boolean
    - If you want to initialize chat as soon as socket connection established

    • This methods starts sdk and opens chat window if initiateChat passed true otherwise it runs in background and only open when called manually.

  2. setSessionListner(sessionListner):
    @param sessionListner
    - pass the instance where you have implemented ServerBackendSocket.onSessionEvents from our sdk

    • Set custom session events listener for our sdk callbacks

  3. openChat():

    • This method is used to open chat if agent is available.

  4. openVideo():

    • This method is used to start chat with Video call this method. It will initialize video call as soon as you are connected to the agent.

  5. openAudio():

    • This method is used to start chat with Audio call this method. It will initialize video call as soon as you are connected to the agent.

  6. setUnreadCountListner(target-activity):
    @param target-activity
    - pass the instance where you want to have unread messages count.

    • Update Text or Badge count as per needed.

  7. setUnreadCountListner(target-activity):
    @param name
    - pass the name you want to display for the visitor
    @param email - pass the email you want to display for the visitor
    @param phone - pass the phone you want to display for the visitor
    @param remarks - pass the remarks you want to display for the visitor

    • Update these Details as per needed(optional).

    • Use this method before initialization.

  8. setShowDefaultFAB(showFAB):
    @param showFAB
    - pass the boolean value true or false.

    • Whether you want to show sdk's default FAB button or not.

    • Use this method before Activity's setContentView() method.

    • On click of the button chat will open by default.


Permissions


We include the INTERNET permission by default as we need it to make network requests:

<uses-permission android:name="android.permission.INTERNET"/>

Run-time permissions:

//Run-time permissions:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

It will ask audio/video permissions when required to make a video call.

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

These permissions needed when an attachment is selected to share from the app.




Dependency graph


Here is our complete dependency graph:


tagove-sdk-core


# Transitive (shared with your app)
+--- com.android.support:appcompat-v7:26.1.0
+--- io.socket:socket.io-client:0.8.3
+--- com.android.support:design:26.1.0
+--- com.mikhaellopez:circularimageview:2.1.1
+--- andhradroid.dev:aFilechooser:1.0.1

# Repackaged (not shared with your app)
+--- com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0
+--- com.squareup.picasso:picasso:2.5.2
+--- com.google.code.gson:gson:2.8.1
                                    



Building


  • Make sure you've installed the Android 7.1.1 SDK and upgraded to the latest version of Android Studio

  • Make sure you've updated all support repository and Google Play Services repository packages in the Android SDK manager

  • Check out or Download nilayTagove/DemoApp project for easy setup for your project.

  • See the configuration and clone the environment into your project to run our Tagove chat sdk.




Note : If you are using gradle Plugin version 3.0 then use implementation instead of compile.


If you are using gradle Plugin version 3.0 then use implementation instead of compile.


For release apk if you want to give support to arm-v7 ABI only then use "'com.tagove.sdk:core-arm-v7a:1.+'" instead of "'com.tagove.sdk:core:1.+'". to reduce apk size.

-dontwarn com.squareup.**
-dontwarn okio.**

-keep class org.webrtc.** {*;}
-keep class com.tagove.sdk**
-keep class com.tagove.sdk.activities**
-keep class com.squareup**
-keep class com.jakewharton**
-keepattributes Signature
-keep class sun.misc.Unsafe { *; }

-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**

-keepclassmembers class com.tagove.sdk** {*;}
-keepclassmembers class com.squareup** {*;}
-keepclassmembers class com.jakewharton** {*;}

-keep public class com.tagove.sdk.** {
  public protected *;
}
-keep public class io.socket.** {
  public protected *;
}
-keep public class com.mikhaellopez.** {
  public protected *;
}
                                       


And that's it 👍 Voila!! You had integrated whole chat module in few minutes.

To Enable Debug Mode Please tap on Text chat button on top for 5 times.









-dontwarn com.squareup.**
-dontwarn okio.**

-keep class org.webrtc.** {*;}
-keep class com.tagove.sdk**
-keep class com.tagove.sdk.activities**
-keep class com.squareup**
-keep class com.jakewharton**
-keepattributes Signature
-keep class sun.misc.Unsafe { *; }

-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**

-keepclassmembers class com.tagove.sdk** {*;}
-keepclassmembers class com.squareup** {*;}
-keepclassmembers class com.jakewharton** {*;}

-keep public class com.tagove.sdk.** {
  public protected *;
}
-keep public class io.socket.** {
  public protected *;
}
-keep public class com.mikhaellopez.** {
  public protected *;
}