This website is no longer maintained. Please, visit documentation.indigitall.com to read our updated documentation.
EN |
ESquick integration guide
This article shows the minimum development that must be done to start registering devices and being able to carry out the first push campaigns.
The first thing to do is open the app / build.gradle file. In the screenshot you can see where to find this app / build.gradle file.
AtenciĆ³n: It is the build.gradle file found in the app folder, NOT the root of the project.
The library is available through the repository Maven Central . Maven is one of the most used library management tools in Android. To integrate the Chat of indigitall it is necessary to add the following dependencies:
android {
compileSdkVersion 31
defaultConfig {
minSdkVersion 21
targetSdkVersion 31
}
}
repositories {
mavenCentral()
}
dependencies {
//implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.indigitall:android-chat:1.3.+'
implementation 'io.socket:socket.io-client:0.8.3'
}
To initialize the Chat it is necessary to add the object com.indigitall.android.chat.Chat in the layout where the Chat will be displayed. We must add the following lines of code:
<com.indigitall.android.chat.Chat
android:id="@+id/your_id"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:channelKey="your_channel_key"
//opciones personalizadas
app:externalKey="your_external_key"
app:titleChat="your_title_chat"
app:botName="your_bot_name"
app:defaultUserName="your_user_name_default"
app:messagePlaceholder="your_message_place_holder"
app:openFileText="your_text_open_file"
app:backgroundColor="your_background_color"
app:backgroundBarColor="your_background_bar_color"
app:primaryColor="your_primary_color"
app:fullscreen="bool"
app:defaultChatIconResource="your_chat_custom_icon"
app:addContactTextButton="your_contact_text_button"
app:contactAddedMessage="your_contact_added_message"
app:infoContactIconsColor="your_info_contact_icons_color"
app:infoContactTopBarTitle="your_info_contact_top_bar_title"
app:chatAutoOpenTime="your_chat_auto_open_time_in_seconds"
app:clearMessages="bool"
app:welcomeEvent="your_welcome_event"
/>
The following fields are custom. If they are not added, the Chat will show the default values.
To verify that the integration was successful, do the following:
To be able to perform actions when the Chat is shown or hidden, event handlers or listeners can be implemented. To do this add the following code:
class YourActivity: ChatListener{
...
override fun onChatHidden() {
//Do something
}
override fun onChatShown() {
//Do something
}
}
You can check if the welcome event has been fired with this method:
val indigitallChat = findViewById<Chat>(R.id.chat)
val isEmitted = indigitallChat.isWelcomeEmitted();
If you want to send a message custom you can use this method:
val indigitallChat = findViewById<Chat>(R.id.chat)
indigitallChat.setCustomEvent("Your_event");
You can also control the action of deleting messages with this method:
val indigitallChat = findViewById<Chat>(R.id.chat)
indigitallChat.clearAllMessages()
Start automating your communications thanks to our administration API