{"id":3096,"date":"2017-07-16T12:07:53","date_gmt":"2017-07-16T12:07:53","guid":{"rendered":"https:\/\/www.rumbletalk.com\/blog\/?p=3096"},"modified":"2021-06-15T07:47:04","modified_gmt":"2021-06-15T07:47:04","slug":"new-login-sdk-functions-logout-logoutcb-for-developers","status":"publish","type":"post","link":"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/","title":{"rendered":"New Login SDK functions: Logout &#038; LogoutCB (For Developers)"},"content":{"rendered":"<p>This is one of the most requested features by our customers using the RumbleTalk Login SDK.<\/p>\n<p>When users have logged in automatically via the Login SDK. They actually\u00a0inherit the credentials from the chat owner users base and are allowed to login automatically.<br \/>\nHowever, if the chat owner wishes to force a logout of a user, he was unable to do so.<\/p>\n<p>Now, he can.\u00a0RumbleTalk is happy to announce a new two Logout options.<strong><br \/>\n<\/strong><\/p>\n<h2><strong>Logout<\/strong><\/h2>\n<p>Chat owner\u00a0can now initiate logout of users using the Login SDK.<\/p>\n<p>To do so, call the following function:<\/p>\n<pre>&lt;script type=\"text\/javascript\"&gt;\nrtmq(\n    'logout',\n    {\n        userId: '<strong>USERS_ID<\/strong>', \/\/ [optional]\n        username: '<strong>USERS_NAME<\/strong>' \/\/ [optional]\n    }\n);\n&lt;\/script&gt;\n<\/pre>\n<p>The [optional] parameters &#8220;<strong>USERS_ID<\/strong>&#8221; and &#8220;<strong>USERS_ID<\/strong>&#8221; are optional and used only to validate that the correct user is being logged out.<br \/>\nThey can be used separately or together.<br \/>\nExcluding them will remove the connected user (who&#8217;s browser called the function) regardless of their &#8220;user id&#8221; and\\or &#8220;username&#8221;<\/p>\n<h2><strong>Logout Callback<\/strong><\/h2>\n<p>Chat owners can now also listen to the event of a user logout.<\/p>\n<p>To do so, call the following function:<\/p>\n<pre>&lt;script type=\"text\/javascript\"&gt;\nrtmq(\n    'logoutCB',\n    {\n        callback: '<b>CALLBACK_FUNCTION<\/b>'\n    }\n);\n&lt;\/script&gt;\n<\/pre>\n<p>The &#8220;<strong>CALLBACK_FUNCTION<\/strong>&#8221; will be called with a\u00a0&#8220;reason&#8221;\u00a0variable when the user logs out of the chat.<br \/>\nAn example of the callback function is such:<\/p>\n<pre>function (reason) {\n    console.log(reason);\n    \/\/ code to execute on logout\n}\n<\/pre>\n<p>currently, the following values are possible for the <strong>reason<\/strong> variable:<\/p>\n<ul>\n<li>&#8220;button_clicked&#8221; &#8211; the user clicked on the logout button<\/li>\n<li>&#8220;sdk_request&#8221; &#8211; the &#8220;logout&#8221; function of the SDK was called<\/li>\n<li>&#8220;unknown&#8221; &#8211; the user disconnected from the chat for an unknown reason (such as network connectivity problems)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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\u00a0inherit 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, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"featured_image_url":"","seo_focus_kw":"","seo_meta_desc":""},"categories":[259,260,4],"tags":[261,262],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.10 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>New Login SDK functions: Logout &amp; LogoutCB (For Developers)<\/title>\n<meta name=\"description\" content=\"NEW SDK: This is one of the most requested features by our customers using the RumbleTalk Login SDK.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New Login SDK functions: Logout &amp; LogoutCB (For Developers)\" \/>\n<meta property=\"og:description\" content=\"NEW SDK: This is one of the most requested features by our customers using the RumbleTalk Login SDK.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/\" \/>\n<meta property=\"og:site_name\" content=\"Online Group Chat Room Plugin for Websites and Live events\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/rumbletalk\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-16T12:07:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-15T07:47:04+00:00\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rumbletalk\" \/>\n<meta name=\"twitter:site\" content=\"@rumbletalk\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/\",\"url\":\"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/\",\"name\":\"New Login SDK functions: Logout & LogoutCB (For Developers)\",\"isPartOf\":{\"@id\":\"https:\/\/rumbletalk.com\/blog\/#website\"},\"datePublished\":\"2017-07-16T12:07:53+00:00\",\"dateModified\":\"2021-06-15T07:47:04+00:00\",\"author\":{\"@id\":\"https:\/\/rumbletalk.com\/blog\/#\/schema\/person\/25d71b46ff2470eaf367d02f9d47726c\"},\"description\":\"NEW SDK: This is one of the most requested features by our customers using the RumbleTalk Login SDK.\",\"breadcrumb\":{\"@id\":\"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/rumbletalk.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New Login SDK functions: Logout &#038; LogoutCB (For Developers)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/rumbletalk.com\/blog\/#website\",\"url\":\"https:\/\/rumbletalk.com\/blog\/\",\"name\":\"Online Group Chat Plugin for Websites and Event\",\"description\":\"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.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/rumbletalk.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/rumbletalk.com\/blog\/#\/schema\/person\/25d71b46ff2470eaf367d02f9d47726c\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/rumbletalk.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1944e05b00ac133489dacf7fca386d64?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1944e05b00ac133489dacf7fca386d64?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"description\":\"This is the admin of the kingdom :)\",\"sameAs\":[\"https:\/\/rumbletalk.com\"],\"url\":\"https:\/\/rumbletalk.com\/blog\/index.php\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New Login SDK functions: Logout & LogoutCB (For Developers)","description":"NEW SDK: This is one of the most requested features by our customers using the RumbleTalk Login SDK.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/","og_locale":"en_US","og_type":"article","og_title":"New Login SDK functions: Logout & LogoutCB (For Developers)","og_description":"NEW SDK: This is one of the most requested features by our customers using the RumbleTalk Login SDK.","og_url":"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/","og_site_name":"Online Group Chat Room Plugin for Websites and Live events","article_publisher":"https:\/\/www.facebook.com\/rumbletalk","article_published_time":"2017-07-16T12:07:53+00:00","article_modified_time":"2021-06-15T07:47:04+00:00","author":"Editor","twitter_card":"summary_large_image","twitter_creator":"@rumbletalk","twitter_site":"@rumbletalk","twitter_misc":{"Written by":"Editor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/","url":"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/","name":"New Login SDK functions: Logout & LogoutCB (For Developers)","isPartOf":{"@id":"https:\/\/rumbletalk.com\/blog\/#website"},"datePublished":"2017-07-16T12:07:53+00:00","dateModified":"2021-06-15T07:47:04+00:00","author":{"@id":"https:\/\/rumbletalk.com\/blog\/#\/schema\/person\/25d71b46ff2470eaf367d02f9d47726c"},"description":"NEW SDK: This is one of the most requested features by our customers using the RumbleTalk Login SDK.","breadcrumb":{"@id":"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/rumbletalk.com\/blog\/index.php\/2017\/07\/16\/new-login-sdk-functions-logout-logoutcb-for-developers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rumbletalk.com\/blog\/"},{"@type":"ListItem","position":2,"name":"New Login SDK functions: Logout &#038; LogoutCB (For Developers)"}]},{"@type":"WebSite","@id":"https:\/\/rumbletalk.com\/blog\/#website","url":"https:\/\/rumbletalk.com\/blog\/","name":"Online Group Chat Plugin for Websites and Event","description":"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.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rumbletalk.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/rumbletalk.com\/blog\/#\/schema\/person\/25d71b46ff2470eaf367d02f9d47726c","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rumbletalk.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1944e05b00ac133489dacf7fca386d64?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1944e05b00ac133489dacf7fca386d64?s=96&d=mm&r=g","caption":"Editor"},"description":"This is the admin of the kingdom :)","sameAs":["https:\/\/rumbletalk.com"],"url":"https:\/\/rumbletalk.com\/blog\/index.php\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/rumbletalk.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3096"}],"collection":[{"href":"https:\/\/rumbletalk.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rumbletalk.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rumbletalk.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rumbletalk.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=3096"}],"version-history":[{"count":10,"href":"https:\/\/rumbletalk.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3096\/revisions"}],"predecessor-version":[{"id":10525,"href":"https:\/\/rumbletalk.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3096\/revisions\/10525"}],"wp:attachment":[{"href":"https:\/\/rumbletalk.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=3096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rumbletalk.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=3096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rumbletalk.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=3096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}