Suggestions

close search

StringeeClient

public class StringeeClient
extends Object



Represents a Stringee client.
The first step in using Stringee Android SDK is to initialize a StringeeClient instance by calling the StringeeClient(Context context) constructor. Then connects to Stringee server by calling connect, pass in the access token.
For test purposes, you can generate the test token in [Dashboard -> Tools -> Generate Access token](https://developer.stringee.com/project/tool).



Summary


Public Constructors
StringeeClient(Context context)

Construct a new StringeeClient with a context

Public methods
void connect(String token)

Connects to Stringee server, using provided access token.

void disconnect()

Disconnects from Stringee server.

boolean isConnected()

Checks whether the client is connected to Stringee server.

void registerPushToken(String token, StatusListener listener)

Registers the registration token for push notification to Stringee server.

void sendCustomMessage(String toUser, JSONObject msg, StatusListener listener)

Send a custom message to a user.

void setConnectionListener(StringeeConnectionListener connectionListener)

Sets a SessionStringeeConnectionListener object to monitor when the client connects and disconnects from Stringee server.

void unregisterPushToken(String token, StatusListener listener)

Removes the registration token for push notification from Stringee server.


Public constructors


StringeeClient

StringeeClient(Context context)

Construct a new StringeeClient with a context.

Parameters
context

The Android application context associated with this process.



Public methods


connect

void connect(String token)

Connects to Stringee server, using provided access token.

Parameters
token

The access token generated by your server.



disconnect

void disconnect()

Disconnects from Stringee server.



isConnected

boolean isConnected()

Checks whether the client is connected to Stringee server.



registerPushToken

void registerPushToken(String token, StatusListener listener)

Registers the registration token for push notification to Stringee server.

Parameters
token

The registration token

listener

The StatusListener instance.



sendCustomMessage

void sendCustomMessage(String toUser, JSONObject msg, StatusListener listener)

Send a custom message to a user.

Parameters
toUser

User id to send a custom message to.

msg

Message to send.

listener

A StatusListener instance.



setConnectionListener

void setConnectionListener(StringeeConnectionListener connectionListener)

Sets a SessionStringeeConnectionListener object to monitor when the client connects and disconnects from Stringee server.

Parameters
connectionListener

The StringeeConnectionListener instance.



unregisterPushToken

void unregisterPushToken(String token, StatusListener listener)

Removes the registration token for push notification from Stringee server.

Parameters
token

The registration token

listener

The StatusListener instance.