Skip to content

Example application guide

Alexander Boldyrev edited this page Oct 17, 2024 · 8 revisions

For 5.x version - Example Application Guide 5.x

How to run example application

Prepare application configuration in portal

As the first step, you will need to have a Mobile Messaging application profile set up in Infobip Portal for your account with push registration enabled. If you already have it, then you can skip this section, otherwise:

  1. Prepare your Firebase Cloud Messaging to get google-services.json file and Private Key JSON file.

  2. Prepare your Infobip account to get your application code:

    1. Create new application on Infobip portal.
    2. Navigate to your Application where you will get the application code.
    3. Mark the "Available on Android" checkbox.
    4. Upload previously obtained Google Private Key JSON file.
    MAM Profile

Run example application in Android Studio

  1. Clone Mobile Messaging SDK repository and open the project in Android Studio.
  2. Go to infobip-mobile-messaging-android-demo module and add application code from previous step to strings.xml:
<resources>
    <string name="infobip_application_code">YOUR APPLICATION CODE</string>
    ...
</resources>
  1. Add google-services.json you obtained in previous step to the infobip-mobile-messaging-android-demo folder.
  2. Uncomment apply plugin: 'com.google.gms.google-services' from infobip-mobile-messaging-android-demo/build.gradle in order to apply Google Services Gradle Plugin.

infobip-mobile-messaging-android-demo is an example Android application for Mobile Messaging SDK and it has multiple product flavours configured for different use-cases.

Product flavour Description
push application with simple layout which receives messages sent from the portal or through API
deeplink application which handles deeplinks in messages as described in: How to use "deeplink" to land user to a particular app page?
web application which receives push messages and opens web view on notification tap as described in: How to open application webView on message tap?
chat application with In-app chat where you can send and receive messages from Livechat Widget
chatWithCalls same as chat flavour with example usage of InfobipRtcUi to support WebRTC calls in In-app chat
cryptorMigration application which demonstrates how to migrate from old ECB cryptor

In order to run one of the flavours, select {flavour}Debug or {flavour}Release configuration for infobip-mobile-messaging-android-demo in Build Variants menu in Android Studio and run it as Android application on any Android device or emulator.

Running chat example

Within the example application we offer the chat flavour for testing all available In-app chat features first-hand, and for comparing its source code with yours, in case you are facing any issue in your implementation.

In order to test the In-app chat in example application follow instructions in In-app chat quick start guide.

Our chat flavour has different list of options, from the basic ways of presenting the In-app chat (as Activity, Fragment or View), to customising the chat, not forgetting the change of language for the UI, etc. We invite you to play with it and discover everything Livechat has to offer.

Clone this wiki locally