These instructions will help you in setup server and mobile application.

Introduction

SwatChat is real-time complete chatting app with groups ,Video Conference and voice messages functionality. The user can send pictures, audio, video, contact detail, map location, voice messages, a user can create groups as well.

Setup

  1. Android

    *Note: Phone Authentication or some other functionality will not work on emulator. Kindly use real physical device for testing.

    Before continuing make sure you have :-

    After following the steps given below make sure you have values of all the following keys with you:

    • applicationId
    • app_name
    • support_email
    • sinch_app_key
    • sinch_app_secret
    • sinch_app_environment - set this to clientapi.sinch.com for production app
    • onesignal_app_id - follow https://app.onesignal.com/apps/new to add your app and obtain OneSignal app id

    ADMOB Enable in app level build.gradle file Configure your AdMob banner IDs in ad_unit_id1 and ad_unit_id2. ad_unit_id1 is used on outer chat list screen and ad_unit_id2 is used inside chat page. admob other ads also used in video conference page Switch ENABLE_ADMOB to true Configure your AdMob App ID in meta tag with name “com.google.android.gms.ads.APPLICATION_ID” in AndroidManifest.xml file. Save changes and sync gradle. note: you will need to build the project at least once to be able to use build configurations. i.e. -> BuildConfig.ENABLE_ADMOB

    ADMOB Disable in app level build.gradle file Simply switch ENABLE_ADMOB boolean field to false. Remove meta tag with name “com.google.android.gms.ads.APPLICATION_ID” from AndroidManifest.xml file. Save changes and sync gradle. note: you will need to build the project at least once to be able to use build configurations. i.e. -> BuildConfig.ENABLE_ADMOB

    You will need to update above values in app/build.gradle

    Refactoring

    • Change the applicationId in app/build.gradle, set this to the package name you want to keep for your application e.g com.SwatChat
    • Use the same package name while setting up android app in Firebase in the next step.
    • Logo and placeholders used in app are png images which you will find in app/src/main/res/drawable folder.
    • To change the images in app simply replace the images at above mentioned location with your images.

    Firebase Setup

    • Create a Firebase account or log into an existing account.

    • Click Add project. Follow the remaining setup steps and click Create project.

    • After the wizard provisions your project, click Continue.

    • In the Overview page of your project, click the Settings gear and then click Project settings.

    • Click Add Firebase to your Android app and follow the wizard

    • In Debug signing certificate SHA-1, enter the SHA-1 value you generated in the previous section.

    • Click Register app.

    • Download the google-services.json file and place it in app folder.

    • Click Next in the Download config file section and follow the rest of the steps if required.

    • Next click on Authentication and click on Sign-in method

    • Enable Phone Authentication

    • Similarly enable Realtime Database and Storage from side menu.

    Configuration and Theming

    • Open app/build.gradle, you need to edit/add values in respective fields in defaultConfig under android
    • Fill in applicationId with your package name which you registered on firebase console
    • Fill in app_name and support_email with your desired app name and support email
    • For audio and video calling follow https://portal.sinch.com/#/signup to register your app name. Follow on screen instructions to obtain App Key and App Secret. Fill in these values in sinch_app_key and sinch_app_secret respectively. Finally setup sinch_app_environment configuration according to your sinch portal.
    • For notifications follow https://app.onesignal.com/apps/new to add your app and obtain OneSignal app id which will be used in onesignal_app_id under manifestPlaceholders.
    • You Don't have to change anything for video conferencing.