SDK Archives - Online Group Chat Room Plugin for Websites and Live events https://rumbletalk.com/blog/index.php/category/sdk/ Embed a social group chat for communities and events. Grow your online audience with the next evolution of HTML chat room. Attach files, Mobile, Audio and Video calls. Tue, 15 Jun 2021 07:47:04 +0000 en-US hourly 1 https://wordpress.org/?v=6.2.2 New Login SDK functions: Logout & LogoutCB (For Developers) https://rumbletalk.com/blog/index.php/2017/07/16/new-login-sdk-functions-logout-logoutcb-for-developers/ Sun, 16 Jul 2017 12:07:53 +0000 https://www.rumbletalk.com/blog/?p=3096 This is one of the most requested features by our customers using the RumbleTalk Login SDK. When users have logged in automatically via the Login SDK. They actually inherit the credentials from the chat owner users base and are allowed to login automatically. However, if the chat owner wishes to force a logout of a user, […]

The post New Login SDK functions: Logout & LogoutCB (For Developers) appeared first on Online Group Chat Room Plugin for Websites and Live events.

]]>
This is one of the most requested features by our customers using the RumbleTalk Login SDK.

When users have logged in automatically via the Login SDK. They actually inherit the credentials from the chat owner users base and are allowed to login automatically.
However, if the chat owner wishes to force a logout of a user, he was unable to do so.

Now, he can. RumbleTalk is happy to announce a new two Logout options.

Logout

Chat owner can now initiate logout of users using the Login SDK.

To do so, call the following function:

<script type="text/javascript">
rtmq(
    'logout',
    {
        userId: 'USERS_ID', // [optional]
        username: 'USERS_NAME' // [optional]
    }
);
</script>

The [optional] parameters “USERS_ID” and “USERS_ID” are optional and used only to validate that the correct user is being logged out.
They can be used separately or together.
Excluding them will remove the connected user (who’s browser called the function) regardless of their “user id” and\or “username”

Logout Callback

Chat owners can now also listen to the event of a user logout.

To do so, call the following function:

<script type="text/javascript">
rtmq(
    'logoutCB',
    {
        callback: 'CALLBACK_FUNCTION'
    }
);
</script>

The “CALLBACK_FUNCTION” will be called with a “reason” variable when the user logs out of the chat.
An example of the callback function is such:

function (reason) {
    console.log(reason);
    // code to execute on logout
}

currently, the following values are possible for the reason variable:

  • “button_clicked” – the user clicked on the logout button
  • “sdk_request” – the “logout” function of the SDK was called
  • “unknown” – the user disconnected from the chat for an unknown reason (such as network connectivity problems)

The post New Login SDK functions: Logout & LogoutCB (For Developers) appeared first on Online Group Chat Room Plugin for Websites and Live events.

]]>