Skip to content

Commit

Permalink
4.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit-cometchat committed Jun 6, 2024
1 parent 1a8442b commit 06a0de7
Show file tree
Hide file tree
Showing 25 changed files with 29 additions and 215 deletions.
Binary file removed 4.0.6/chat-sdk-android-4.0.6.aar
Binary file not shown.
1 change: 0 additions & 1 deletion 4.0.6/chat-sdk-android-4.0.6.aar.md5

This file was deleted.

1 change: 0 additions & 1 deletion 4.0.6/chat-sdk-android-4.0.6.aar.sha1

This file was deleted.

1 change: 0 additions & 1 deletion 4.0.6/chat-sdk-android-4.0.6.aar.sha256

This file was deleted.

1 change: 0 additions & 1 deletion 4.0.6/chat-sdk-android-4.0.6.aar.sha512

This file was deleted.

1 change: 0 additions & 1 deletion 4.0.6/chat-sdk-android-4.0.6.pom.md5

This file was deleted.

1 change: 0 additions & 1 deletion 4.0.6/chat-sdk-android-4.0.6.pom.sha1

This file was deleted.

1 change: 0 additions & 1 deletion 4.0.6/chat-sdk-android-4.0.6.pom.sha256

This file was deleted.

1 change: 0 additions & 1 deletion 4.0.6/chat-sdk-android-4.0.6.pom.sha512

This file was deleted.

Binary file added 4.0.7/chat-sdk-android-4.0.7.aar
Binary file not shown.
1 change: 1 addition & 0 deletions 4.0.7/chat-sdk-android-4.0.7.aar.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a1a864bf6dc88c6ce37b6eb5c1a4421c
1 change: 1 addition & 0 deletions 4.0.7/chat-sdk-android-4.0.7.aar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d83fe80635792de69d5719ff957c8ef3d4e31084
1 change: 1 addition & 0 deletions 4.0.7/chat-sdk-android-4.0.7.aar.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d20df1b78ef2c6ea84ade5426aa7b9f757f9d4e3b93ec9367115e739a0c56e21
1 change: 1 addition & 0 deletions 4.0.7/chat-sdk-android-4.0.7.aar.sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7c82692572b5f93e48bfacd5d4a2bbad387f5435cc3505c6dd9b1d3fc2de678353043470f5f0d3b7108643317f2e0195305a26764863d281f775df6046575527
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.cometchat</groupId>
<artifactId>chat-sdk-android</artifactId>
<version>4.0.6</version>
<version>4.0.7</version>
<packaging>aar</packaging>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions 4.0.7/chat-sdk-android-4.0.7.pom.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1ba3da544f474d2d647a126bd97ba790
1 change: 1 addition & 0 deletions 4.0.7/chat-sdk-android-4.0.7.pom.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6c9a0ed145acbab9537b044da145874414266335
1 change: 1 addition & 0 deletions 4.0.7/chat-sdk-android-4.0.7.pom.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
50b907b3d42a230916b2c4bae5b11d6bb03a42660fc8e0c16abcc938b71f9610
1 change: 1 addition & 0 deletions 4.0.7/chat-sdk-android-4.0.7.pom.sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
77d0eb5a13ca320d2016fb1102316a11c775d1707c540f644252cfbc148b17ded7c20a1ad5aec6ea2ac5990cdf032d8d4b9d14d984e22cba1fb80aa65ff5b145
211 changes: 12 additions & 199 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,205 +2,18 @@
<img alt="CometChat" src="https://assets.cometchat.io/website/images/logos/banner.png">
</p>

# CometChat Android Chat SDK
# CometChat SDK for Android
The CometChat SDK is a robust toolkit that developers can utilize to swiftly incorporate a reliable and fully-featured chat functionality into an existing or new application. It removes the complexity of building a chat infrastructure from scratch, thus accelerating the development process and reducing time to market.

CometChat enables you to add voice, video & text chat for your website & app.
This guide demonstrates how to add chat to an Android application using CometChat.
## Prerequisites
- Android 5.0, API 21 and above

## Getting Started
To set up Android SDK and utilize CometChat for your chat and calls functionality, you'll need to follow these steps:
- Register at the [CometChat Dashboard](https://app.cometchat.com/) to create an account.
- After registering, log into your CometChat account and create a new app. Once created, CometChat will generate an Auth Key and App ID for you. Keep these credentials secure as you'll need them later.
- Check the [key concepts](https://cometchat.com/docs/android-chat-sdk/key-concepts) to understand the basic components of CometChat.
- Refer to the [Integration Steps](https://cometchat.com/docs/android-chat-sdk/setup) in our documentation to integrate the SDK into your Android app.

[![Platform](https://img.shields.io/badge/Platform-Android-brightgreen)](#)
<a href=" "> <img src="https://img.shields.io/badge/Version-4.0.6-important" /></a>
![GitHub repo size](https://img.shields.io/github/repo-size/cometchat-pro/android-chat-sdk)
![GitHub contributors](https://img.shields.io/github/contributors/cometchat-pro/android-chat-sdk)
![GitHub stars](https://img.shields.io/github/stars/cometchat-pro/android-chat-sdk?style=social)
![Twitter Follow](https://img.shields.io/twitter/follow/cometchat?style=social)
<hr/>


## Prerequisites :star:
Before you begin, ensure you have met the following requirements:<br/>
&nbsp; You have `Android Studio` installed in your machine.<br/>
&nbsp; You have a `Android Device or Emulator` with Android Version 6.0 or above.<br/>
&nbsp; You have read [CometChat Key Concepts](https://prodocs.cometchat.com/docs/concepts).<br/>

<hr/>

## Installing CometChat Android SDK
## Setup :wrench:

To setup Android SDK, you need to first register on CometChat Dashboard. [Click here to sign up](https://app.cometchat.com/login).

### i. Get your Application Keys :key:

<a href="https://app.cometchat.io" target="_blank">Signup for CometChat</a> and then:

1. Create a new app: Click **Add App** option available → Enter App Name & other information → Create App
2. At the Top in **QuickStart** section you will find **Auth Key** & **App ID** or else you can head over to the **API & Auth Keys** section and note the **Auth Key** and **App ID**
<img align="center" src="https://files.readme.io/4b771c5-qs_copy.jpg"/>

<hr/>

### ii. Add the CometChat Dependency
<ul>
<li>
<b>CometChat as a module</b><br/>
1. Download the latest aar file from .<br/>
2. Navigate to your project in Android Studio.<br/>
3. Click on **File** and select **New** -> **Module**<br/>
4. Now select Import.JAR/AAR package from the available options.<br/>
5. Specify the path to the .aar file dowloaded earlier.<br/>
6. Now open the app level build.gradle file and under the dependencies section add the below line:<br/>

```groovy
implementation project(path: ':chat-sdk-android-$version')
```
where $version is the version of the aar downloaded.

Now that the CometChat module is successfully added to your project, you need to follow the below steps to add CometChat dependency bundle to your project.

1. Open the project level build.gradle file and in the `repositories` section under `allprojects` add the below line:

``` groovy
allprojects {
repositories {
maven {
url "https://dl.cloudsmith.io/public/cometchat/cometchat/maven/"
}
}
}
```
2. Now open the app level build.gradle file and add the below line under the `dependencies` section:

``` groovy
dependencies {
implementation 'com.cometchat:chat-sdk-android-dependencies:4.0.6'
}
```
</li><li>
<b>CometChat via gradle</b>
If you do not wish to add the CometChat dependency as a module, you can directly add the CometChat SDK to your project using gradle.
Open the app level build.gradle file and <br/>

1. Add the below line in the dependencies section.

```groovy
dependencies {
implementation 'com.cometchat:chat-sdk-android:4.0.6'
}
```
2. Add the below lines android section

```groovy
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
```
## Please Note:
**v2.4+ onwards, Voice & Video Calling functionality has been moved to a separate library. Please add the following dependency to your app level `build.gradle` file in case you plan on using the Voice & Video Calling feature.**

```groovy
dependencies {
implementation 'com.cometchat:calls-sdk-android:{calling_module_latest_version}'
}
```
To know the latest version of the Calling dependency, please check the [Calling documentation](https://prodocs.cometchat.com/docs/android-calling)

You can refer to the below link for instructions on how to do so:<br/>
[📝 Add CometChat Dependency](https://prodocs.cometchat.com/docs/android-quick-start#section-add-the-cometchat-dependency)
</li>
</ul>
<hr/>

## Configure CometChat SDK

### i. Initialize CometChat 🌟
The init() method initializes the settings required for CometChat. We suggest calling the init() method on app startup, preferably in the onCreate() method of the Application class.

```java
String appID = "APP_ID"; // Replace with your App ID
String region = "REGION"; // Replace with your App Region ("eu" or "us")

AppSettings appSettings=new AppSettings.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build();

CometChat.init(this, appID,appSettings, new CometChat.CallbackListener<String>() {
@Override
public void onSuccess(String successMessage) {
Log.d(TAG, "Initialization completed successfully");
}
@Override
public void onError(CometChatException e) {
Log.d(TAG, "Initialization failed with exception: " + e.getMessage());
}
});
```

| :information_source: &nbsp; <b> Note - Make sure to replace `region` and `appID` with your credentials.</b> |
|------------------------------------------------------------------------------------------------------------|

### ii. Create User 👤
Once initialisation is successful, you will need to create a user. You need to user createUser() method to create user on the fly.
```java
String authKey = "AUTH_KEY"; // Replace with your App Auth Key
User user = new User();
user.setUid("user1"); // Replace with the UID for the user to be created
user.setName("Kevin"); // Replace with the name of the user

CometChat.createUser(user, authKey, new CometChat.CallbackListener<User>() {
@Override
public void onSuccess(User user) {
Log.d("createUser", user.toString());
}

@Override
public void onError(CometChatException e) {
Log.e("createUser", e.getMessage());
}
});
```

| :information_source: &nbsp; <b>Note - Make sure that UID and name are specified as these are mandatory fields to create a user.</b> |
|------------------------------------------------------------------------------------------------------------|

<hr/>

### iii. Login User 👤
Once you have created the user successfully, you will need to log the user into CometChat using the login() method.
```java
String UID = "user1"; // Replace with the UID of the user to login
String authKey = "AUTH_KEY"; // Replace with your App Auth Key

if (CometChat.getLoggedInUser() == null) {
CometChat.login(UID, authKey, new CometChat.CallbackListener<User>() {

@Override
public void onSuccess(User user) {
Log.d(TAG, "Login Successful : " + user.toString());
}

@Override
public void onError(CometChatException e) {
Log.d(TAG, "Login failed with exception: " + e.getMessage());
}
});
} else {
// User already logged in
}
```

| :information_source: &nbsp; <b>Note - The login() method needs to be called only once. Also replace AUTH_KEY with your App Auth Key.</b> |
|------------------------------------------------------------------------------------------------------------|

<hr/>

📝 Please refer to our [Developer Documentation](https://prodocs.cometchat.com/docs/android-quick-start) for more information on how to configure the CometChat SDK and implement various features using the same.

<hr/>


## Contact :mailbox:
Contact us via real time support present in [CometChat Dashboard.](https://app.cometchat.io/)
<hr/>

## Help and Support
For issues running the project or integrating with our SDK, consult our [documentation](https://www.cometchat.com/docs/android-chat-sdk/overview) or create a [support ticket](https://help.cometchat.com/hc/en-us) or seek real-time support via the [CometChat Dashboard](https://app.cometchat.com/).
7 changes: 4 additions & 3 deletions maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<groupId>com.cometchat</groupId>
<artifactId>chat-sdk-android</artifactId>
<versioning>
<latest>4.0.6</latest>
<release>4.0.6</release>
<latest>4.0.7</latest>
<release>4.0.7</release>
<versions>
<version>3.0.15</version>
<version>4.0.0</version>
Expand Down Expand Up @@ -33,7 +33,8 @@
<version>4.0.5-beta1</version>
<version>4.0.5</version>
<version>4.0.6</version>
<version>4.0.7</version>
</versions>
<lastUpdated>20240416135413</lastUpdated>
<lastUpdated>20240606082220</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
44e38fe483d3a170673f98e833d1d83f
7d30ceeed2124f9139db85d07d08c348
2 changes: 1 addition & 1 deletion maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
93f6a34d12fd45f95676ddea196fd3912c0c7387
bf37c582bc4b6a018518dc56f29f05f34db0c891
2 changes: 1 addition & 1 deletion maven-metadata.xml.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bf4651d5c281096a01961fc9dbd302a8c8a881825e99f08dc972d7558bc94e5d
57d13432b4ab7fbf93506eff82852683a488269afc6dafda886b6b46ad4edba9
2 changes: 1 addition & 1 deletion maven-metadata.xml.sha512
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6ef402a5c95fb43748044505605f0ea5d311b6967acf848d3a1298d970bf8211b7bc06f73f7392e479606a5a3f0d6548a927b4f83fef53b032b9828944b357c5
b6c4302d16efceec76f0b19c8982bf02c5c04a1071afee1c8df928fd864b7dbe800f84dd82319a9f150451664e00be105cd15aa91edc5307145ee7b30b0555e9

0 comments on commit 06a0de7

Please sign in to comment.