Integrate with Android app


Below Steps shows an overview for developers integrating with Floatbot.ai SDK for the first time. It guides you through the process of setting up and sending and receiving instant messages.

To register your app for broadcast messages. Set push notification token in floatbot for receiving messages over GCM or FCM (Optional)

FloatBot.setPushToken("push token")

To start using Floatbot in android app, write below line anywhere in your activity/fragment


@Override 
public void onMessageReceived(RemoteMessage remoteMessage) 
{ 
	FloatBot.processmessage(context,remoteMessage.getData(),MainActivity.class); 
}


Note : MainActivity.class - > this activity will be called when notification will be clicked

Similarly if you are using GCM in your project,call this method in your function
GcmListenerService on MessageRecived function


@Override
public void onMessageReceived(RemoteMessage remoteMessage) 
{  
	FloatBot.processmessage(context,remoteMessage.getData(),MainActivity.class);
}

Note : MainActivity.class - > this activity will be called when notification will be clicked.

To Set Mobile number in Floatbot to identify a particular user (Optional)

overide">FloatBot.setMobileNumber("Mobilenumber");

To Enable iBeacon Support inside your Floatbot. Send your iBeacon information to Floatbot Sdk through below function

FloatBot.IBeaconDetected(UUID,Major,Minor);

The UUID, Major and Minor parameters are your iBeacon's identifier and make up the key component of the Advertising packets that are continually transmitted by your Beacons.

Add maven { ... } part of code like below inside project level build.gradle file.


allprojects 
{ 
	repositories 
	{ 
maven { url "https://jitpack.io" } maven { url "http://13.77.84.178:8081/artifactory/libs-release-local" } } }

Open build.gradle inside module that will use floatbot and simply add a dependency.


dependencies 
{ 
	compile 'ai.floatbot:floatbot:1.5.53'
}

To start using Floatbot in android app, write below line anywhere in your activity/fragment

FloatBot.startChat(this,”Bot ID”,”Token”,"Bot name")

You will find Bot ID and Token in the chatbot settings of your Bot.

  • Go to Chatbot Section of your Dashboard

chatbot development platform

  • Go to Settings of your Chatbot

customer engagement bot

  • Inside Settings of your chatbot, you will find BOT ID and Token.

chatbot for call center

You can have a look at Sample