Getting Started

Initialization

Before using the Social SDK, you need to create a new SDK instance with your API key. Please find your account API key in Amity Social Cloud Console.

After logging in Console:

  1. Click Settings to expand the menu.

  2. Select Security.

  3. In the Security page, you can find the API key in the Keys section.

If you have trouble finding this, you can post in our community forum at community.amity.co so our support team can assist you.

Specify Endpoints Manually (Optional)

By default AmityCoreClient will connect to AmityRegionalHttpEndpoint.SG. If you want to change the region you can do so by passing httpEndpoint parameter:

We currently support multi-data center capabilities for the following regions:

RegionEndpoint

Europe

AmityRegionalHttpEndpoint.EU

Singapore

AmityRegionalHttpEndpoint.SG

United States

AmityRegionalHttpEndpoint.US

Authentication

In order to use any Amity Social SDK feature, you must first log in the current device with a userId. A logged in device will be tied to the userId until the device is either proactively logged out, or until the device has been inactive for over 90 days. A logged in device will receive all the events messages belonging to the tied user.

An optional displayName can be provided, which will be used in standard push notifications (related to user's actions, such as when the new post is sent).

An authToken can also be provided, which will be used for authentication. Should you choose to use insecure settings on your network, this parameter can be ignored.

On the client side, you will need to receive that authToken from before, and use it in the login() call.

For more info on how to configure secure settings and obtain authToken, refer to Security. documentation. https://docs.amity.co/console/settings/security.

The displayName is set only on the first time the device is logged in. Please follow your platform's necessary directions if you would like to rename this to something else.

Logout

When the user logs out, you should explicitly log out the user from the SDK as well. This prevents the current device from receiving unnecessary and/or restricted data.

Logout is an asynchronous operation. Once the logout method is called, the SDK disconnects from the server and wipes out user session.

Devices

Each user can be registered, at the same time, to an unlimited number of devices. Amity's Social SDK will automatically synchronize the user data across all registered devices. We will also automatically unregister any device that has not been connected to the server for more than 90 days.

When a device is unregistered due to inactivity, the SDK data on the device will be reset. You will need to re-register this device in order to connect to the server again.

Last updated