{"id":4252,"date":"2021-11-12T19:21:10","date_gmt":"2021-11-12T11:21:10","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4252"},"modified":"2025-02-24T15:00:17","modified_gmt":"2025-02-24T07:00:17","slug":"custom-signalling","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/android-toolkit\/custom-signalling\/","title":{"rendered":"Custom Signalling: Android SDK &#8211; Video API"},"content":{"rendered":"\n<p>The <code>EnxRoom.sendUserData()<\/code> method allows you to send customized data adhering to a structure not bound by the Portal message structure, to one or more users connected in a session. This allows your application to send not just messages but also structured instructions, polls, or any data that requires a customized data structure as per your business requirement.  <\/p>\n\n\n\n<p><strong>Class:<\/strong> EnxRoom<\/p>\n\n\n\n<p><strong>Method:&nbsp;<\/strong> <code>public void sendUserData(JSONObject data, boolean isBroadcast, array RecipientIDs)  <\/code><\/p>\n\n\n\n<p><strong>Parameters<\/strong>:<\/p>\n\n\n\n<ul><li><code>data&nbsp;<\/code>\u2013 JSON Object containing custom keys. This object is passed to the Recipients without any structure enforcement. Be advised to define keys effectively for signaling needs.<\/li><li><code>isBroadcast&nbsp;<\/code>\u2013 Boolean. Set to&nbsp;<em>true&nbsp;<\/em>for Public Broadcast and <em>false&nbsp;<\/em>for signaling to one or more recipients.<\/li><li><code>RecipientIDs<\/code>&nbsp;\u2013 Array of Client IDs of recipients of the message when not broadcasting. <\/li><\/ul>\n\n\n\n<p><strong>Callback<\/strong>:&nbsp; <\/p>\n\n\n\n<ul><li><code>onUserDataReceived<\/code> \u2013 Receives signaling in JSONObject. Available from Android SDK v1.5.3 onwards.<\/li><\/ul>\n\n\n\n<p><strong>data JSONObject Sample<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Example: You can put Important Information with custom keys\n\/\/ You may define the JSONObject as per your business needs\n\nJSONObject data = {\n    \"sender\": \"Sender's Name\",\n    \"message\": \"Message body\",\n    \"custom_key\": \"Data\"\n}<\/pre>\n\n\n\n<p><strong>To send &amp; receive Custom Signaling<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">List&lt;String&lt; Recipient_ClientIds;\n\nroom.sendMessage(data, true, null); \/\/ Signaling to all\n\n\/\/ Signaling to one or selected Recipients\nroom.sendUserData(data, false, Recipient_ClientIds);\n\n\/\/ Users receive Signaling Message through Callback\n\/\/ Available from v1.5.3.\nPublic void onUserDataReceived(JSONObject jsonobject){\n    \/\/ Handle JSON Object\n} <\/pre>\n\n\n\n<p><strong>Error Codes \/ Exceptions<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Code<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>5127<\/td><td>Exceeding maximum allowed data transfer rate of 100Kb.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p>\u2190 <a href=\"..\/chat\/\">Send Message<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-center\"><a href=\"..\/\">Index<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-right\"><a href=\"..\/file-share\/\">File Sharing<\/a> \u2192<a href=\"\/developer\/how-to-use\/\"><\/a><\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The EnxRoom.sendUserData() method allows you to send customized data adhering to a structure not bound by the Portal message structure, to one or more users connected in a session. This allows your application to send not just messages but also structured instructions, polls, or any data that requires a customized data structure as per your business requirement. Class: EnxRoom Method:&nbsp; public void sendUserData(JSONObject data, boolean isBroadcast, array RecipientIDs) Parameters: data&nbsp;\u2013&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3740,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"featured":false,"featured-large":false},"uagb_author_info":{"display_name":"vcxdevwpadmin","author_link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/author\/vcxdevwpadmin\/"},"uagb_comment_info":0,"uagb_excerpt":"The EnxRoom.sendUserData() method allows you to send customized data adhering to a structure not bound by the Portal message structure, to one or more users connected in a session. This allows your application to send not just messages but also structured instructions, polls, or any data that requires a customized data structure as per your&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4252"}],"collection":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/comments?post=4252"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4252\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3740"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}