forked from cometchat/cometchat-uikit-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
params.json
1 lines (1 loc) · 5.17 KB
/
params.json
1
{"name":"Android Chat UI Kit","tagline":"Android Chat UI Kit","body":"<div style=\"width:100%\">\r\n <div style=\"width:50%; display:inline-block\">\r\n <p align=\"center\">\r\n ![Main] (https://github.com/yadavmangesh/android-chat-ui-kit/blob/master/main_ui.png) \r\n </p> \r\n </div> \r\n</div>\r\n</br>\r\n</br>\r\n</div>\r\n\r\n# What is UI Kit\r\nThe UI Kit library is collection of custom UI Component and UI Screens design to build chat application within few minutes. \r\nUI kit is designed to avoid boilerplate code for building UI,it has three different ways to build a chat application with fully customizable UI.It will help developers to build a chat application within using various UI Components. \r\n\r\n\r\n## Setup\r\n Follow the below metioned steps for easy setup and seamless integration with UI Kit\r\n\r\n### Get your Application Keys\r\n<a href=\"https://app.cometchat.io/\" traget=\"_blank\">Signup for CometChat</a> and then:\r\n\r\n* Create a new app\r\n* Head over to the API Keys section and note the `API_Key` and `App_ID` (for Auth Only key)\r\n---\r\n### Add the CometChat Dependency\r\n\r\nFirst, add the repository URL to the **project level** `build.gradle` file in the repositories block under the allprojects section.\r\n```groovy\r\nallprojects {\r\n repositories {\r\n maven {\r\n url \"https://dl.bintray.com/cometchat/pro\"\r\n }\r\n }\r\n}\r\n```\r\nThen, add CometChat to the **app level** `build.gradle` file in the dependencies section.\r\n\r\n```groovy\r\ndependencies {\r\n implementation 'com.cometchat:pro-android-chat-sdk:2.0.1'\r\n}\r\n```\r\nFinally, add the below lines android section of the **app level** gradle file\r\n\r\n```groovy\r\nandroid {\r\n compileOptions {\r\n sourceCompatibility JavaVersion.VERSION_1_8\r\n targetCompatibility JavaVersion.VERSION_1_8\r\n }\r\n}\r\n````\r\n### Initialize CometChat\r\n\r\nThe `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.\r\n```java\r\nprivate String appID = \"APP_ID\";\r\nprivate String region = \"REGION\";\r\n\r\nAppSettings appSettings=new AppSettings.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build();\r\n\r\nCometChat.init(this, appID,appSettings, new CometChat.CallbackListener<String>() {\r\n @Override\r\n public void onSuccess(String successMessage) {\r\n Log.d(TAG, \"Initialization completed successfully\");\r\n }\r\n @Override\r\n public void onError(CometChatException e) {\r\n Log.d(TAG, \"Initialization failed with exception: \" + e.getMessage());\r\n }\r\n});\r\n```\r\n**Note :**\r\nMake sure you replace the APP_ID with your CometChat `App_ID` and `REGION` with your app region in the above code.\r\n\r\n### Log in your User\r\n\r\nThe `login()` method returns the User object containing all the information of the logged-in user.\r\n\r\n```java\r\nprivate String UID = \"SUPERHERO1\";\r\nprivate String API_KEY = \"API_KEY\";\r\n\r\nCometChat.login(UID, API_KEY , new CometChat.CallbackListener<User>() {\r\n @Override\r\n public void onSuccess(User user) {\r\n Log.d(TAG, \"Login Successful : \" + user.toString());\r\n }\r\n @Override\r\n public void onError(CometChatException e) {\r\n Log.d(TAG, \"Login failed with exception: \" + e.getMessage());\r\n }\r\n});\r\n```\r\n**Note :** </br>\r\n* Make sure you replace the `API_KEY` with your CometChat API Key in the above code.\r\n* We have setup 5 users for testing having UIDs: `SUPERHERO1`, `SUPERHERO2`, `SUPERHERO3`,`SUPERHERO4` and `SUPERHERO5`.\r\n\r\n\r\n## Add UI Kit to your project\r\nAfter adding necessary dependancies inside you app to integrate UI Kit inside your app.Kindly follow the below steps: \r\n1. Simply clone the UI Kit Library from android-chat-uikit repository. \r\n3. Import `uikit` Module from Module Settings.\r\n4. If the Library is added sucessfully, it will look like mentioned in the below image. \r\n<img align=\"center\" width=\"auto\" height=\"auto\" src=\"https://github.com/cometchat-pro/android-chat-uikit/blob/master/Screenshot/Screen%20Shot%202019-12-23%20at%207.37.37%20PM.png\">\r\n\r\n\r\n### Launch UI Unified\r\n Add the following code snippet in `onSuccess` of CometChat `login`.\r\n \r\n ```java\r\n startActivity(new Intent(YourActivity.this,CometChatUnified.class))\r\n \r\n```\r\n</br>\r\n<img align=\"center\" width=\"100%\" height=\"auto\" src=\"https://github.com/cometchat-pro/android-chat-uikit/blob/master/Screenshot/UI%20Unified%20(1).png\">\r\n\r\n\r\n*UI Unified is a way to launch a fully working chat application using the UI Kit .In UI Unified all the UI Screens and UI Components working together to give the full experience of a chat application with minimal coding effort.*\r\n\r\n\r\n \r\n## Next Step\r\n\r\n To read the full dcoumentation on UI Kit integration visit our [Documentation](https://prodocs.cometchat.com/docs/android-ui-kit) \r\n\r\n\r\n\r\n## Troubleshooting\r\nFacing any issues while integrating or installing the UI Kit please <a href=\"https://forum.cometchat.com/\"> visit our forum</a>.\r\n","note":"Don't delete this file! It's used internally to help with page regeneration."}