Skip to main content

Connection callbacks let the developer server participate in login authorization when a client starts a connection. Before the connection is established, the IM server calls back to the developer server. The connection is allowed when the developer server returns pass; otherwise, it is rejected. Custom Header values are supported for validation.

Default SDK Header values:

Basic information: x-appkey, x-token, x-platform, x-version, x-device, x-device_id

Authentication and encryption: x-nonce, x-timestamp, x-signature


When to call

After init and before connect.


Parameters

ParameterTypeRequiredDescriptionMinimum version
signKeyStringYesDynamically issued signing key.1.8.47
headersMap<String, String>YesCustom headers.1.8.47

Example

String signKey = "xxxxxxxx";
Map<String, String> m = new HashMap<>();
m.put("key1", "value1");
m.put("key2", "value2");
JIM.getInstance().getConnectionManager().setConnectParams(signKey, m);

// call connect to establish a connection