NCEngine

public class NCEngine

Nexconn SDK global singleton entry point.

The starting point for all SDK operations. Provides core methods such as initialization, connection, disconnection, handler registration, and module access.

Externally provides concise APIs while internally isolating implementation details.

// 1. Basic initialization (required parameters only)
NCEngine.initialize(InitParams(context, "your-app-key"))

// 2. Initialization with optional configuration
NCEngine.initialize(InitParams(context, "your-app-key").apply {
logLevel = LogLevel.DEBUG
naviServer = "nav.custom-server.com"
fileServer = "file.custom-server.com"
areaCode = AreaCode.SG
enablePush = true
compressOptions = CompressOptions().apply {
imageWidth = 1280
imageHeight = 1280
imageQuality = 0.82f
maxOriginalImageSize = 300
thumbnailMaxSize = 320
thumbnailMinSize = 120
thumbnailQuality = 0.35f
sightCompressWidth = 720
sightCompressHeight = 1280
}
})

// 3. Connect
NCEngine.connect(ConnectParams("user-token")) { userId, error ->
if (error == null) {
// Connected successfully
}
}

// 4. Disconnect
NCEngine.disconnect()

Properties

Link copied to clipboard
public final static NCEngine INSTANCE
Link copied to clipboard

Translation module (singleton).

Link copied to clipboard
private final UserModule userModule

User module (singleton).

Functions

Link copied to clipboard
public final Unit addChannelHandler(String identifier, ChannelHandler handler)

Adds a channel status handler.

Link copied to clipboard
public final Unit addConnectionStatusHandler(String identifier, ConnectionStatusHandler handler)

Adds a connection status handler.

Link copied to clipboard
public final Unit addDatabaseStatusHandler(String identifier, DatabaseStatusHandler handler)

Adds a database upgrade status handler.

Link copied to clipboard
public final Unit addGroupChannelHandler(String identifier, GroupChannelHandler handler)

Adds a group channel event handler.

Link copied to clipboard
public final Unit addMessageHandler(String identifier, MessageHandler handler)

Adds a message event handler.

Link copied to clipboard
public final Unit addOpenChannelHandler(String identifier, OpenChannelHandler handler)

Adds an open channel event handler.

Link copied to clipboard
public final Unit addTagHandler(String identifier, TagHandler handler)

Adds a tag event handler.

Link copied to clipboard
public final Unit addTranslateHandler(String identifier, TranslateHandler handler)

Adds a translation event handler.

Link copied to clipboard
public final Unit addUserHandler(String identifier, UserHandler handler)

Adds a user event handler.

Link copied to clipboard
public final Unit addUserSettingsHandler(String identifier, UserSettingsHandler handler)

Adds a user settings event handler.

Link copied to clipboard
public final Unit connect(ConnectParams params, ConnectHandler handler)

Connects to the server.

Link copied to clipboard
public final Unit disconnect(Boolean disablePush)

Disconnects from the server.

Link copied to clipboard
public final AppSettings getAppSettings()

Gets application-level configuration settings.

Link copied to clipboard

Gets the current connection status.

Link copied to clipboard
public final String getCurrentUserId()

Returns the currently connected user ID.

Link copied to clipboard

Gets the current do-not-disturb time settings.

Link copied to clipboard

Translation module (singleton).

Link copied to clipboard
public final UserModule getUserModule()

User module (singleton).

Link copied to clipboard
public final String getVersion()

Returns the SDK version.

Link copied to clipboard
public final Unit initialize(InitParams params)

Initializes the SDK.

Link copied to clipboard
public final Unit registerCustomMessages(List<Class<? extends MessageContent>> messageClasses)

Registers custom message types.

Link copied to clipboard
public final Unit removeChannelHandler(String identifier)

Removes a channel status handler.

Link copied to clipboard
public final Unit removeConnectionStatusHandler(String identifier)

Removes a connection status handler.

Link copied to clipboard
public final Unit removeDatabaseStatusHandler(String identifier)

Removes a database upgrade status handler.

Link copied to clipboard
public final Unit removeGroupChannelHandler(String identifier)

Removes a group channel event handler.

Link copied to clipboard
public final Unit removeMessageHandler(String identifier)

Removes a message event handler.

Link copied to clipboard
public final Unit removeNoDisturbTime(ErrorHandler handler)

Removes the do-not-disturb time settings.

Link copied to clipboard
public final Unit removeOpenChannelHandler(String identifier)

Removes an open channel event handler.

Link copied to clipboard
public final Unit removeTagHandler(String identifier)

Removes a tag event handler.

Link copied to clipboard
public final Unit removeTranslateHandler(String identifier)

Removes a translation event handler.

Link copied to clipboard
public final Unit removeUserHandler(String identifier)

Removes a user event handler.

Link copied to clipboard
public final Unit removeUserSettingsHandler(String identifier)

Removes a user settings event handler.

Link copied to clipboard
public final Unit setNoDisturbTime(NoDisturbTimeParams params, ErrorHandler handler)

Sets the do-not-disturb time for message notifications.