Introduction
Welcome to the documentation for the Freshchat SDK. This page provides you with all the necessary information to integrate Freshchat into your application and enhance your customer support experience.
Features
- Real-time messaging: Enable quick and seamless conversations with your customers.
- In-app messaging: Allow your users to communicate with your support team without leaving your application.
- Push notifications: Receive instant notifications for new messages, ensuring timely response.
- Rich media support: Share images, gifs, and other media files to enhance communication.
- Customizable and branded messaging: Personalize the look and feel of your chat to match your brand identity.
- Conversation context: Maintain context during conversations for better customer support.
Getting Started
To integrate the Freshchat SDK into your application, follow the steps below:
Step 1: Installation
Install the Freshchat SDK by following either of the options:
- Using CocoaPods:
- Manually:
- Download the Freshchat SDK ZIP file from the official website.
- Extract the contents and add the required frameworks to your Xcode project.
- Ensure that the necessary dependencies are also added.
pod 'FreshchatSDK'
Step 2: Configuration
Configure the Freshchat SDK by providing the required API keys and other settings. To configure the SDK:
- Import the Freshchat headers into your application.
- Initialize the Freshchat instance with your Freshchat domain and app ID.
- Set up any additional customization options, such as chat bubble colors or notification settings.
Step 3: Displaying the Chat
To display the chat interface to your users:
- Trigger the chat interface using the relevant action, such as tapping an “Contact Support” button.
- Pass any relevant user information to the SDK, like name and email, to pre-fill the chat form.
- Listen for incoming chat messages and update your UI as necessary.
API Documentation
The Freshchat SDK provides various methods and classes to interact with the chat system. Here are some important ones:
sendMessage(text: String)
Description: Send a text message to the Freshchat conversation.
Parameters:
text
(String): The content of the message to be sent.
Returns: None
// Example usage:
Freshchat.getInstance().sendMessage("Hello, I need some assistance.");
updateUserInfo(user: User)
Description: Update the user information displayed in the conversation.
Parameters:
user
(User): An object containing the updated user information (name, email, etc.).
Returns: None
// Example usage:
let user = User(name: "John Doe", email: "john.doe@example.com")
Freshchat.getInstance().updateUserInfo(user)
Troubleshooting
If you encounter any issues while integrating or using the Freshchat SDK, please refer to the following resources:
- FAQs: Check the frequently asked questions section on the official Freshchat website.
- Support: Contact our support team for assistance.
- Community: Join our community forum to seek guidance from other developers.
Conclusion
Congratulations! You have successfully integrated the Freshchat SDK into your application. Start providing excellent customer support and enjoy seamless communication with your users.