Documentation


Website Integration

A Chatbot created in Floatbot can be embedded on any web page by following below steps

  • Select Settings option from Dashboard
Chatbot Integration
  • Chatbot settings displays all the available chatbot settings. Add the Script from the settings in beginning of body tag of your website.
chatbot in website

Android Integration

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")

NOTE:

Initially Server Key is to be set In Dashboard

If you are using FCM in your project, call this method as very first line in your FirebaseMessagingService.onMessageReceived 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

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

@Override
public void onMessageReceived(String from, Bundle datae) {

FloatBot.processmessage(context,data,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)

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

iOS Integration

Requirements

  • Xcode 9.0
  • iOS 8.0+

Note: SDK supports iOS 8.0 and later

For Manual Integration

1. Download the latest floatbot.framework which is provided as a zip-File.

2. Open your Xcode project or workspace.

3. Go to the Build Phases for the your app target.

4. Add the frameworks to the Link Binaries With Libraries list.

5. Go to the Build Phases for the your app target.

6. Add a New Copy Files Phase by selecting the Add icon. Set the Destination field to Frameworks, and add the framework to the list. Ensure Code Sign on Copy is checked.

7. Add flbAssets.bundle to copy bundle resources of your project

 

For Cocoa Pods Integration

Step 1: Create a Podfile in your project's root directory, if it doesn't exist yet.

Step 2: Add the floatbot pod in Podfile under your desired target:

target 'YOUR-TARGET'
...
       pod ' floatbot'

end

 

Step 3: Run pod repo update && pod install in terminal.

Step 4: Open your project using the generated *.xcworkspace file.

 

Note: SDK supports iOS 8.0 and later.

 

BOT_ID and KEY

To configure floatbot iOS SDK in your app, you will need BOT_ID and KEY from the Settings page.

 
Chatbot Integration

Follow below steps to integrate floatbot SDK to your iOS app

Step 1: Import “floatbot.h” in AppDelegate.m

#import <floatbot/floatbot.h>

Step 2: Initialize and configure floatbot for your app.

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion]  compare:v options:NSNumericSearch] != NSOrderedAscending)

In -[AppDelegate application:didFinishLaunchingWithOptions:] method,

[[floatbotManager sharedManager] setFLB_BOT_ID:BOT_ID]; [[floatbotManager sharedManager] setFLB_KEY:KEY]; [[floatbotManager sharedManager] setBOT_NAME:BOT_NAME];

The above method will set the name of your bot in the app, which will be displayed on the top of chat screen.

SET MOBILE NUMBER WITH COUNTRYCODE (OPTIONAL)

[[floatbotManager sharedManager] setPHONE_NUMBER_WITH_COUNTRY_CODE:PHONE_NO];

Optionally, you can set the mobile number of the user to identify the user. Note: PHONE_NO passed to above method should be the number prefixed with the country code and without “+”.Eg. 9110000001

 

Step 3:Handle Push notification

To enable floatbot to send push notifications to the application, add this implementation of - application:didRegisterForRemoteNotificationsWithDeviceToken: in your AppDelegate file that captures the device token and sends it to floatbot server

Add below snippet in [AppDelegate application:didFinishLaunchingWithOptions:] method

if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
{
   UIUserNotificationSettings *settings =
   [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert |
UIUserNotificationTypeBadge |UIUserNotificationTypeSound categories:nil];
  [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
  [[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
  [[UIApplication sharedApplication]
registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
}
To set push token, add following method
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
[floatbotManager setToken:deviceToken];
}

 

Step 4: Uploading your App’s SSL Push Certificate

1. Go to the Mac OS finder application, and search for “Keychain Access”. Open it. 

2. Find your App’s push certificate in the Certificates section. It will start with the string “"Apple Development iOS Push Services" (“Apple Production iOS push services” in case of production certificate)  

3. Expand the row, and you will find the private key.  

4. Select both the private key and certificate and export it as .p12 file and necessarily set a password. 

5. Upload the saved .p12 file in the field below selecting development environment or production environment depending on whether you are using it for dev or production push services.

Upload your development / production certificate in Settings page

Push Message send for iOS

JSON API

  • The JSON API plugin enables you to integrate your backend into your chatbots on Floatbot.
  • The JSON API plugin enables your bot to send HTTP GET and POST requests and interpret responses

    It allows you to

    1 . Generate dynamic content

    2 . Get and set user attributes

    3 . Redirect users to another block in the bot

    4 . Create postbacks

    If you select POST user attributes get send in the body of the request. GET adds parameters as a query string.The max. timeout is 10 seconds in both cases.

    In your responses, you can

  • Combine several messages in one answer by sending several dictionaries in the messages array.
  • Use any content type header.
  • Send an empty response to not show the user any dynamic content.

Response Reference:

Sending text

Use this response to send text messages.

{
"data":
[
     { "text": "Welcome to Floatbot!" },
     { "text": "How do you do" }
]
}

Sending Text with Button

Use this response to send text with button.

{
"data":
[
    {
     "text": "Welcome to the Floatbot world!",
      "buttons":
       [
          {
            "type" : "url",
             "title" : "Test",
             "link" : "https://floatbot.ai/"
          }
       ]
      }
]
}

Sending Text with Quick Reply

Use this response to send text with Quick Reply.

{
"data":
[
    {
     "text": "Welcome to the Floatbot world!",
                 "attribute":"f_name",
      "quick_reply":
       [
          {
              "title" : "Yes"
          },          
         {
              "title" : "No"          
         }
       ]
      
}
]
}


Get started for free


Start on our free plan and scale up as you grow.





Copyrights © 2018 by Floatbot