No callback on connect
Possible reasons:
-
SDK not initialized. Call connect after initialization.
-
libRongIMLib.so file doesn’t match the SDK version.
Download the correct SDK version from the official site and replace the libRongIMLib.so file. -
Multiple connect calls in the App layer triggered almost simultaneously may clear the callback.
Call connect only once during the app lifecycle. The SDK has a reconnection mechanism, so multiple connect calls aren’t needed.
onError callback for connect
The callback includes an error code. Refer to the error code list for details: https://docs.rongcloud.io/android-imlib/code
Note: Android 9.0+ devices don’t support plaintext transmission, only support https.
onTokenIncorrect callback for connect (2.x)
This callback only exists in the 2.x SDK, indicating an invalid/expired token. In 4.x/5.x, it’s merged into onError.
Possible reasons:
-
Incorrect App Key. Verify the App Key.
-
Incorrect token.
RC doesn’t support direct token retrieval by the client. The App Server must request a token from the RC IM Server.
Ensure the App Key matches the one used by the App Server to get the token.
Use the Developer Console to check token validity: Developer Console → Operations Management → User Management. See screenshot:
暂无
-
Expired token.
Set the token validity period in the Developer Console: Console → Basic Information → App Key. See screenshot:
If the issue persists after checking the above, submit a ticket with the SDK logs from /sdcard/Android/data/package_name/files/rong_log.