im::floo::floolib::BMXClient

Client

Inherits from im.floo.floolib.BMXNetworkListener

Public Functions

Name
synchronized void delete()
BMXSDKConfig getSDKConfig()
Get SDK settings
BMXUserService getUserService()
Get user Service
BMXChatService getChatService()
Get chat Service
BMXGroupService getGroupService()
Get group Service
BMXRosterService getRosterService()
Get roster Service
BMXPushService getPushService()
Get push Service
BMXUserManager getUserManager()
Get user Manager
BMXChatManager getChatManager()
Get chat Manager
BMXGroupManager getGroupManager()
Get group Manager
BMXRosterManager getRosterManager()
Get roster Manager
BMXPushManager getPushManager()
Get push Manager
[BMXErrorCode] signUpNewUser(String username, String password, BMXUserProfile bmxUserProfilePtr)
To register a new user, username and password are required
[BMXErrorCode] signInByName(String name, String password)
Login by username
[BMXErrorCode] signInById(long arg0, String password)
Login by user ID
[BMXErrorCode] fastSignInByName(String name, String password)
Quick login by username (requires a successful previous login, faster login)
[BMXErrorCode] fastSignInById(long uid, String password)
Quick login by user ID (requires a successful previous login, faster login)
[BMXErrorCode] signOut(long uid, boolean ignoreUnbindDevice)
Log out
[BMXErrorCode] signOut(long uid)
[BMXErrorCode] signOut()
[BMXConnectStatus] connectStatus()
Get the current connection state with server
[BMXSignInStatus] signInStatus()
Get the current login state
void reconnect()
Force reconnection
void onNetworkChanged([BMXNetworkType] type, boolean reconnect)
Process network changes in messaging
void disconnect()
Disconnect
[BMXErrorCode] changeAppId(String appId, String appSecret)
Change the appId of SDK, which also update the appId in BMXConfig.
[BMXErrorCode] changeAppId(String appId)
Change the appId of SDK, which also update the appId in BMXConfig.
[BMXErrorCode] initializeServerConfig(boolean isLocal)
Get the server network configuration of app, which can be called after initializing SDK and before logging in, so as to get the server configuration in advance and speed up logging in.
void sendMessage(BMXMessage msg)
When send a message, the change of message status will be notified by listener. In the case of sending a group message in a specified group with group read acknowledgement enabled, the interface will automatically obtain the group member list id and fill it in the message config, without the need for the client to fill the group member list by itself.
BMXClient create(BMXSDKConfig config)
Create BMXClient

Protected Functions

Name
BMXClient(long cPtr, boolean cMemoryOwn)
void finalize()
long getCPtr(BMXClient obj)

Additional inherited members

Public Functions inherited from im.floo.floolib.BMXNetworkListener

Name
void swigReleaseOwnership()
void swigTakeOwnership()
BMXNetworkListener()

Protected Functions inherited from im.floo.floolib.BMXNetworkListener

Name
BMXNetworkListener(long cPtr, boolean cMemoryOwn)
void swigDirectorDisconnect()

Public Functions Documentation

function delete

inline synchronized void delete()

Reimplements: im::floo::floolib::BMXNetworkListener::delete

Example:

function getSDKConfig

inline BMXSDKConfig getSDKConfig()

Get SDK settings

Return: BMXSDKConfigPtr

Example:

public static void changeDNS(String server, int port, String restServer) {
    if (bmxClient == null || bmxClient.getSDKConfig() == null) {
        return;
    }
    //Same config of dns enabled
    if (bmxClient.getSDKConfig().getEnableDNS() && (TextUtils.isEmpty(server) || port <= 0 || TextUtils.isEmpty(restServer))){
        return;
    }
    BMXSDKConfig conf  = bmxClient.getSDKConfig();
    BMXSDKConfig.HostConfig hostConfig = conf.getHostConfig();
    //Same config of dns disabled
    if (!bmxClient.getSDKConfig().getEnableDNS() &&
            hostConfig.getImHost().equals(server) &&
            hostConfig.getImPort() == port &&
            hostConfig.getRestHost().equals(restServer)){
        return;
    }
    if (!TextUtils.isEmpty(server) && port > 0 && !TextUtils.isEmpty(restServer)) {
        // 三项数据都不为空才设置
        hostConfig.setImHost(server);
public static void changeDNS(String server, int port, String restServer) {
    if (bmxClient == null || bmxClient.getSDKConfig() == null) {
        return;
    }
    //Same config of dns enabled
    if (bmxClient.getSDKConfig().getEnableDNS() && (TextUtils.isEmpty(server) || port <= 0 || TextUtils.isEmpty(restServer))){
        return;
    }
    BMXSDKConfig conf  = bmxClient.getSDKConfig();
    BMXSDKConfig.HostConfig hostConfig = conf.getHostConfig();
    //Same config of dns disabled
    if (!bmxClient.getSDKConfig().getEnableDNS() &&
            hostConfig.getImHost().equals(server) &&
            hostConfig.getImPort() == port &&
            hostConfig.getRestHost().equals(restServer)){
        return;
    }
    if (!TextUtils.isEmpty(server) && port > 0 && !TextUtils.isEmpty(restServer)) {
        // 三项数据都不为空才设置
        hostConfig.setImHost(server);
public static void changeDNS(String server, int port, String restServer) {
    if (bmxClient == null || bmxClient.getSDKConfig() == null) {
        return;
    }
    //Same config of dns enabled
    if (bmxClient.getSDKConfig().getEnableDNS() && (TextUtils.isEmpty(server) || port <= 0 || TextUtils.isEmpty(restServer))){
        return;
    }
    BMXSDKConfig conf  = bmxClient.getSDKConfig();
    BMXSDKConfig.HostConfig hostConfig = conf.getHostConfig();
    //Same config of dns disabled
    if (!bmxClient.getSDKConfig().getEnableDNS() &&
            hostConfig.getImHost().equals(server) &&
            hostConfig.getImPort() == port &&
            hostConfig.getRestHost().equals(restServer)){
        return;
    }
    if (!TextUtils.isEmpty(server) && port > 0 && !TextUtils.isEmpty(restServer)) {
        // 三项数据都不为空才设置
        hostConfig.setImHost(server);
if (bmxClient == null || bmxClient.getSDKConfig() == null) {
    return;
}
//Same config of dns enabled
if (bmxClient.getSDKConfig().getEnableDNS() && (TextUtils.isEmpty(server) || port <= 0 || TextUtils.isEmpty(restServer))){
    return;
}
BMXSDKConfig conf  = bmxClient.getSDKConfig();
BMXSDKConfig.HostConfig hostConfig = conf.getHostConfig();
//Same config of dns disabled
if (!bmxClient.getSDKConfig().getEnableDNS() &&
        hostConfig.getImHost().equals(server) &&
        hostConfig.getImPort() == port &&
        hostConfig.getRestHost().equals(restServer)){
    return;
}
if (!TextUtils.isEmpty(server) && port > 0 && !TextUtils.isEmpty(restServer)) {
    // 三项数据都不为空才设置
    hostConfig.setImHost(server);
    hostConfig.setImPort(port);
@Override
protected void initDataForActivity() {
    // 获取app版本
    String versionName = BuildConfig.VERSION_NAME;
    mAppVersion.setText("Lanying IM Version:" + versionName);
    BMXClient client = BaseManager.getBMXClient();
    String sdkVersion = "";
    if (client != null && client.getSDKConfig() != null
            && !TextUtils.isEmpty(client.getSDKConfig().getSDKVersion())) {
        sdkVersion = client.getSDKConfig().getSDKVersion();
    }
    mFlooVersion.setText("FlooSDK Version:" + sdkVersion);
@Override
protected void initDataForActivity() {
    // 获取app版本
    String versionName = BuildConfig.VERSION_NAME;
    mAppVersion.setText("Lanying IM Version:" + versionName);
    BMXClient client = BaseManager.getBMXClient();
    String sdkVersion = "";
    if (client != null && client.getSDKConfig() != null
            && !TextUtils.isEmpty(client.getSDKConfig().getSDKVersion())) {
        sdkVersion = client.getSDKConfig().getSDKVersion();
    }
    mFlooVersion.setText("FlooSDK Version:" + sdkVersion);
@Override
protected void initDataForActivity() {
    // 获取app版本
    String versionName = BuildConfig.VERSION_NAME;
    mAppVersion.setText("Lanying IM Version:" + versionName);
    BMXClient client = BaseManager.getBMXClient();
    String sdkVersion = "";
    if (client != null && client.getSDKConfig() != null
            && !TextUtils.isEmpty(client.getSDKConfig().getSDKVersion())) {
        sdkVersion = client.getSDKConfig().getSDKVersion();
    }
    mFlooVersion.setText("FlooSDK Version:" + sdkVersion);

function getUserService

inline BMXUserService getUserService()

Get user Service

Return: BMXUserService

Example:

function getChatService

inline BMXChatService getChatService()

Get chat Service

Return: BMXChatService

Example:

function getGroupService

inline BMXGroupService getGroupService()

Get group Service

Return: BMXGroupService

Example:

function getRosterService

inline BMXRosterService getRosterService()

Get roster Service

Return: BMXRosterService

Example:

function getPushService

inline BMXPushService getPushService()

Get push Service

Return: BMXPushService

Example:

function getUserManager

inline BMXUserManager getUserManager()

Get user Manager

Return: BMXUserManager

Example:

function getChatManager

inline BMXChatManager getChatManager()

Get chat Manager

Return: BMXChatManager

Example:

function getGroupManager

inline BMXGroupManager getGroupManager()

Get group Manager

Return: BMXGroupManager

Example:

function getRosterManager

inline BMXRosterManager getRosterManager()

Get roster Manager

Return: BMXRosterManager

Example:

function getPushManager

inline BMXPushManager getPushManager()

Get push Manager

Return: BMXPushManager

Example:

function signUpNewUser

inline BMXErrorCode signUpNewUser(
    String username,
    String password,
    BMXUserProfile bmxUserProfilePtr
)

To register a new user, username and password are required

Parameters:

  • username Username
  • password User password
  • bmxUserProfilePtr After successful registration, get the profile of the newly registered user from this function, and initially passed in a pointing-to-empty shared_ptr object.

Return: [BMXErrorCode]

Example:

function signInByName

inline BMXErrorCode signInByName(
    String name,
    String password
)

Login by username

Parameters:

  • name Username
  • password User password

Return: [BMXErrorCode]

Example:

function signInById

inline BMXErrorCode signInById(
    long arg0,
    String password
)

Login by user ID

Parameters:

  • arg0 User id
  • password User password

Return: [BMXErrorCode]

Example:

function fastSignInByName

inline BMXErrorCode fastSignInByName(
    String name,
    String password
)

Quick login by username (requires a successful previous login, faster login)

Parameters:

  • name Username
  • password User password (for sdk to automatically update user token when internal token expires)

Return: [BMXErrorCode]

Example:

function fastSignInById

inline BMXErrorCode fastSignInById(
    long uid,
    String password
)

Quick login by user ID (requires a successful previous login, faster login)

Parameters:

  • uid User id
  • password User password (for sdk to automatically update user token when internal token expires)

Return: [BMXErrorCode]

Example:

function signOut

inline BMXErrorCode signOut(
    long uid,
    boolean ignoreUnbindDevice
)

Log out

Parameters:

  • uid UID of logged out user (default 0 to logout the current user)
  • ignoreUnbindDevice Whether the unbind device operation is ignored when the user logout. Set to true when server's unbinding device operation is ignored and forced to logout directly when some servers are inaccessible.

Return: [BMXErrorCode]

Example:

function signOut

inline BMXErrorCode signOut(
    long uid
)

Example:

function signOut

inline BMXErrorCode signOut()

Example:

function connectStatus

inline BMXConnectStatus connectStatus()

Get the current connection state with server

Return: [BMXConnectStatus]

Example:

function signInStatus

inline BMXSignInStatus signInStatus()

Get the current login state

Return: [BMXSignInStatus]

Example:

function reconnect

inline void reconnect()

Force reconnection

Example:

function onNetworkChanged

inline void onNetworkChanged(
    BMXNetworkType type,
    boolean reconnect
)

Process network changes in messaging

Parameters:

  • type Changed network type
  • reconnect Network needs to reconnect or not

Reimplements: im::floo::floolib::BMXNetworkListener::onNetworkChanged

Example:

function disconnect

inline void disconnect()

Disconnect

Example:

function changeAppId

inline BMXErrorCode changeAppId(
    String appId,
    String appSecret
)

Change the appId of SDK, which also update the appId in BMXConfig.

Parameters:

  • appId Newly changed appId
  • appSecret Newly changed appSecret

Example:

function changeAppId

inline BMXErrorCode changeAppId(
    String appId
)

Change the appId of SDK, which also update the appId in BMXConfig.

Parameters:

  • appId Newly changed appId

Example:

function initializeServerConfig

inline BMXErrorCode initializeServerConfig(
    boolean isLocal
)

Get the server network configuration of app, which can be called after initializing SDK and before logging in, so as to get the server configuration in advance and speed up logging in.

Parameters:

  • isLocal True to use locally cached DNS configuration, false to get the latest configuration from server.

Example:

function sendMessage

inline void sendMessage(
    BMXMessage msg
)

When send a message, the change of message status will be notified by listener. In the case of sending a group message in a specified group with group read acknowledgement enabled, the interface will automatically obtain the group member list id and fill it in the message config, without the need for the client to fill the group member list by itself.

Parameters:

  • msg Message to be sent

Example:

function create

static inline BMXClient create(
    BMXSDKConfig config
)

Create BMXClient

Parameters:

  • config BMXSDKConfig SDK configuration object created by local client-side already

Return: BMXClientPtr

Protected Functions Documentation

Example:

    public static void initBMXSDK() {
        String appPath = getFilesPath(AppContextUtils.getAppContext());
        File dataPath = new File(appPath + "/data_dir");
        File cachePath = new File(appPath + "/cache_dir");
        dataPath.mkdirs();
        cachePath.mkdirs();

        String pushId = getPushId();
        BMXSDKConfig conf = new BMXSDKConfig(BMXClientType.Android, "1", dataPath.getAbsolutePath(),
                cachePath.getAbsolutePath(), TextUtils.isEmpty(pushId) ? "MaxIM" : pushId);
        conf.setAppID(SharePreferenceUtils.getInstance().getAppId());
//        conf.setAppSecret(ScanConfigs.CODE_SECRET);
        conf.setConsoleOutput(true);
        conf.setLoadAllServerConversations(true);
        conf.setLogLevel(BMXLogLevel.Debug);
        conf.setDeviceUuid(RomUtil.getDeviceId());
        conf.setEnvironmentType(BMXPushEnvironmentType.Production);
        conf.setPushProviderType(getProvideType(AppContextUtils.getAppContext()));
        bmxClient = BMXClient.create(conf);

function BMXClient

inline BMXClient(
    long cPtr,
    boolean cMemoryOwn
)

Example:

function finalize

inline void finalize()

Reimplements: im::floo::floolib::BMXNetworkListener::finalize

Example:

function getCPtr

static inline long getCPtr(
    BMXClient obj
)

Example:


Updated on 2022-01-26 at 17:18:31 +0800

© 2019-2023 MaximTop | Homepage Last modified time: 2023-08-09 14:48:15

results matching ""

    No results matching ""