[Under Development] Initialization
Our SDK is currently under review. Check back later for updates.
Initialize AcquireSupport SDK
Step 1: Get your Acquire Account ID
You can find your accountID
as shown in image below :
Step 2: Verify your users
Make sure your users are who they claim to be with identity verification. Enforce identity verification to prevent other from pretend to be (third party) for entertainment or fraud logged-in users. Generate an HMAC with SHA256
whenever a user logs into your app. Most web frameworks will have a method or library to help you do this.
You'll need your app’s secret key and the email of the currently logged-in user.
Secret Key
For example, in Ruby on Rails we can generate our HMAC using a method called OpenSSL::HMAC.hexdigest
, where the first parameter is the name of a hash function (we use SHA256
), the second is YOUR_SECRET_KEY
, and the third is your USER_EMAIL
.
Keep your secret key safe! Never commit it directly to your repository, client-side code, or anywhere a third party can find it.
To set up identity verification, you'll need to generate an HMAC on your server for each logged-in user and set in acquireIOSupport SDK.
setVisitorIdentityFields
To set visitor identity for SDK, use setVisitorIdentityFields
which takes identity parameters such as “email” and its value as an argument.
Parameter | Type | Description |
fields | [String: Any] | identified parameter as key and its value |
setVisitorIdentityFields()
must be called before setAccount: takes place and must pass same email as passed insetVisitorDetails()
.
startSession
You must call this method to start a session with Acquire server. After calling startSession()
, the AcquireIODelegate
the delegate will receive either didChangeConnectionStatus:
or onError:
setAccount: should be called first before calling above method
Step 3: Setup Account
To setup an account, call below method.
Parameter | Type | Description |
ACCOUNT_ID | String | your account id from acquire dashboard from Step 1 |
domain | String (Optional) | your testing domain url. (If not provided, default domain is Acquire Live Domain) |
configOptions | [String : Any] | config options. For more details on config options Click here |
showSupport
Calling this method will start a connection session with acquire server. After calling showSupport()
, the AcquireIODelegate
delegate will receive either didChangeConnectionStatus:
or onError:
Parameter | Type | Description |
viewController | UIViewController | instance of viewcontroller on which support button should be displayed |
setAccount: should be called first before calling above method
loadAcquireIOSupportFonts
To load SDK's default Fonts, following method must be called before setAccount:
User APIs
To customize visitor’s identification, you can call following sdk method to set the name, phone, email and fields of the app visitor. This is part of additional visitor configuration.
Set Visitor Details
Use this method before initialization of sdk otherwise it wont work.
Parameter | Type | Description |
data | [String: Any] | details of contact fields e.g.["name":"abc","phone":"xxxxxxxx","email":"abc@gmail.com"] |
Pass nil values for both name and email to clear out old existing values.
If this is provided through the api, user will not be prompted to re-enter this information again.
Update Visitor Details
Use this method after initialization of sdk otherwise it wont work.
Parameter | Type | Description |
data | [String: Any] | details of contact fields parameters. e.g.["name":"abc","phone":"xxxxxxxx","email":"abc@gmail.com"] |
Pass nil values for both name and email to clear out old existing values.
If this is provided through the api, user will not be prompted to re-enter this information again.
Logout visitor
If you have set visitor hash (HMAC digest) and visitor just logged out from account and need to manage user integrity with agent, call method logoutVisitor()
to remove all acquire data from your app related to visitorHash
. To logout
from AcquireIOSupport, calling below method is mandatary:
Methods
getVisitorId
To fetch visitorID after acquire session Connected. Returns string
getAvailableAgentCount
To fetch total number of available agents. Returns Int
.
getOnlineAgentIDs
To fetch agentIDs of online agents. Returns [NSNumber]
.
dismissChatSupport
This optional method will dismiss the support view from the screen.
Last updated