Initialization

Initialize AcquireSupport SDK

Step 1: Get your Acquire Account ID
You can find your accountID as shown in image below :
Get Acquire Account ID
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

User Authentication
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.

setVisitorHash

If your visitor is identified (i.e., visitor has already logged in your app and you have a email address of visitor), call the following method before setAccount: an identified user.
1
AcquireIO.support.setVisitorHash(<_Nonnull_Generated_HMAC_of_email>)
Copied!
Parameter
Type
Description
_Nonnull_Generated_HMAC_of_email
String
A HMAC digest of the visitor email.
setVisitorHash() must be called before setAccount: takes place and must pass same email in setVisitorDetails().

setVisitorIdentityFields

To set visitor identity for SDK, use setVisitorIdentityFields which takes identity parameters such as “email” and its value as an argument.
1
AcquireIO.support.setVisitorIdentityFields(["email":"[email protected]"])
Copied!
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 in setVisitorDetails().

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:
1
AcquireIO.support.startSession()
Copied!
setAccount: should be called first before calling above method
Step 3: Setup Account
To setup an account, call below method.
1
AcquireIO.support.setAccount("your_acquire_account_id", domain: "optional_testing_domain_url", withOptions: config)
Copied!
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:
1
AcquireIO.support.showSupport(<viewcontroller_instance>)
Copied!
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:
1
UIFont.loadAcquireIOSupportFonts
Copied!

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.
1
func setVisitorDetails(_ data: [String: Any])
Copied!
Parameter
Type
Description
data
[String: Any]
details of contact fields e.g.["name":"abc","phone":"xxxxxxxx","email":"[email protected]"]
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.
1
func updateVisitorDetails(_ data: [String: Any])
Copied!
Parameter
Type
Description
data
[String: Any]
details of contact fields parameters. e.g.["name":"abc","phone":"xxxxxxxx","email":"[email protected]"]
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:
1
AcquireIO.support.logoutVisitor()
Copied!

Methods

getVisitorId

To fetch visitorID after acquire session Connected. Returns string
1
let visitorID = AcquireIO.support.getVisitorID()
Copied!

getAvailableAgentCount

To fetch total number of available agents. Returns Int.
1
let agentsAvailableCount = AcquireIO.support.getAvailableAgentCount()
Copied!

getOnlineAgentIDs

To fetch agentIDs of online agents. Returns [NSNumber].
1
let agentsIDs = AcquireIO.support.getOnlineAgentIDs()
Copied!

dismissChatSupport

This optional method will dismiss the support view from the screen.
1
AcquireIO.support.dismissChatSupport()
Copied!
Last modified 3mo ago