GithubHelp home page GithubHelp logo

UseDeskSPM

Swift Package Manager

This manual in other languages

Also available in Russian

Adding a library to the project

Swift Package Manager

.package(url: "https://github.com/usedesk/UseDeskSPM.git", from: "1.3.0")

Initializing SDK

Parameters used in the configuration SDK

Where * — required parameter

Parameter Type Description
CompanyID* String Company ID in Usedesk
How to find a company ID
ChannelID* String ID of the chat channel through which messages from the application will be placed at Usedesk
How to create and set up a channel
Url* String Server URL for SDK chats
By default: pubsubsec.usedesk.ru
If you use server version of Usedesk on your own server, value may be different for you. Check with our team for valid URL — [email protected]
Port String Server port for SDK chats
By default: 443
UrlAPI* String URL to work with Usedesk API
By default: secure.usedesk.ru/uapi
If you use server version of Usedesk on your own server, value may be different for you. Check with our team for valid URL — [email protected]
API_token String Usedesk API Token
How to get API Token
KnowledgeBaseID String Knowledge Base ID
How to create a Knowledge Base
If ID is not provided, Knowledge Base will not be used
UrlToSendFile String URL for sending files
By default: https://secure.usedesk.ru/uapi/v1/send_file
Name String Client name
Email String Client email
Phone String Client phone
Avatar Data? Client avatar
AvatarUrl URL? URL of client avatar image
Avatar parameter has higher priority
Token String A unique token that uniquely identifies the user and his conversation
The token is provided in the callback after the initialization of the chat and is linked to the mail-phone-user name.
To identify different users on the same device, you must store and pass the received token to the initialization method
AdditionalId String Additional customer ID
Note String Text of note
AdditionalFields Int : String Array of ticket additional fields
Format: id : "value"
For text fields the value is a string, for a list the value is a string with the exact list value, for a flag the value is a string false or true
AdditionalNestedFields Int : String Array of additional fields of nested list type
Each subarray represents one nested list.
Format of nested list: [id1: "value", id2 : "value", id3 : "value"], where id1, id2, id3 — value identifiers by nesting levels
FirstMessage String Automatic message
Sent immediately after initialization on behalf of the client
CountMessagesOnInit Int Number of loaded messages when starting the chat
When client open a chat, a specified number of messages are loaded. As client scrolls chat, 20 more messages are loaded
LocaleIdentifier String Language Identifier
Available languages: Russian (ru), English (en), Portugiese (pt), Spanish (es).
If passed identifier is not supported, the Russian language will be used
CustomLocale String : String Your own translation dictionary
If the SDK needs to be displayed in a language we do not support, you can create a translation dictionary yourself and use it
isSaveTokensInUserDefaults Bool The flag of automatic display of the controller in the specified parent controller
By default: true

SDK Initializing

let usedesk = UseDeskSDK()
usedesk.start(
    companyID: "1234567",
    chanelId: "1234", 
    url: "pubsubsec.usedesk.ru", 
    port: "443",
    urlAPI: "pubsubsec.usedesk.ru", 
    api_token: "143ed59g90ef093s",
    urlToSendFile: "https://secure.usedesk.ru/uapi/v1/send_file", 
    knowledgeBaseID: "12",
    name: "Name", 
    email: "[email protected]", 
    phone: "89000000000", 
    avatar: avatarData,
    token: "Token", 
    additional_id: "additional_id",
    note: "Note text", 
    additionalFields: [1 : "value"], 
    additionalNestedFields: [[1 : "value1", 2 : "value2", 3 : "value3"]], 
    firstMessage: "message",
    сountMessagesOnInit: 30,
    localeIdentifier: "en", 
    customLocale: customLocaleDictionary,
    isSaveTokensInUserDefaults: true,
    connectionStatus: { success, feedbackStatus, token in },
    errorStatus: { udError, description in }
)

Parameters returned by the block

СonnectionStatus

Type Description
Bool Successful connection to the chat
UDFeedbackStatus Feedback form display status
String User token

ErrorStatus

Type Description
UDError Documented error type
String? Error description

Documentation

Methods for working with the SDK, customization of elements, and errors are described in our documentation: https://sdk.usedocs.com

Authors

Sergey, [email protected]

License

UseDesk_SDK_Swift is available under the MIT license. See the LICENSE file for more info

UseDesk's Projects

texture icon texture

Smooth asynchronous user interfaces for iOS apps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.