{"id":4349,"date":"2021-11-17T20:35:03","date_gmt":"2021-11-17T12:35:03","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4349"},"modified":"2022-04-08T18:36:18","modified_gmt":"2022-04-08T10:36:18","slug":"chat","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/ios-toolkit\/chat\/","title":{"rendered":"Chat: iOS SDK &#8211; Video API"},"content":{"rendered":"\n<p>The <code>EnxRoom.sendMessage()<\/code> is used to exchange messages between Session participants. It allows you to exchange the following types of messages: <\/p>\n\n\n\n<ul><li><strong>Public Messaging:&nbsp;<\/strong>To send messages to all connected users.<\/li><li><strong>Private Messaging:&nbsp;<\/strong>To send messages to a specific user.<\/li><li><strong>Group Messaging:<\/strong>&nbsp;To send messages to more than one user.<\/li><\/ul>\n\n\n\n<p>The Messaging feature does not require the sender to publish Local Stream or the receiver to subscribe to Remote Stream.<\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxRoom<\/code> <\/p>\n\n\n\n<p><strong>Method<\/strong>: <code>-(void)sendMessage:(NSString *)message isBroadCast:(BOOL)broadcast recipientIDs:(NSArray *)clientIds;<\/code><\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>message<\/code>&nbsp;\u2013 String type message. <\/li><li>is<code>BroadCast<\/code>&nbsp;\u2013 Boolean. Set to <em>true&nbsp;<\/em>for Public Messaging, <em>false&nbsp;<\/em>for Private Messaging.<\/li><li><code>recipientIDs <\/code>\u2013 Array of Client IDs to receive messages. Applicable for Group and Private Messaging.<\/li><\/ul>\n\n\n\n<p><strong>Delegate Method<\/strong>: <\/p>\n\n\n\n<ul><li> <code style=\"background-color: rgb(255, 255, 255);\">- room:didMessageReceived:<\/code> &#8211;  Receives message in JSONObject.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">NSArray *clientArray = [NSArray arrayWithObjects:@\"xxx\",@\"xxx\", nil]\n\n\/\/ Private message to one or selected Recipients\n[room sendMessage:[NSString stringWithFormat:@\"%@\",text] isBroadCast:true recipientIDs:clientArray]; \n\n\/\/ Users Receive Message through Callback \n\/\/ Available from v1.5.3.\n- (void)room:(EnxRoom *)room didMessageReceived:(NSArray *)data {\n    \/\/ data contains incoming message\n}<\/pre>\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=\"..\/room-information\/\">Know Your Room<\/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=\"..\/custom-signalling\/\">Custom Signalling<\/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.sendMessage() is used to exchange messages between Session participants. It allows you to exchange the following types of messages: Public Messaging:&nbsp;To send messages to all connected users. Private Messaging:&nbsp;To send messages to a specific user. Group Messaging:&nbsp;To send messages to more than one user. The Messaging feature does not require the sender to publish Local Stream or the receiver to subscribe to Remote Stream. Class: EnxRoom Method: -(void)sendMessage:(NSString *)message&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3732,"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.sendMessage() is used to exchange messages between Session participants. It allows you to exchange the following types of messages: Public Messaging:&nbsp;To send messages to all connected users. Private Messaging:&nbsp;To send messages to a specific user. Group Messaging:&nbsp;To send messages to more than one user. The Messaging feature does not require the sender to publish&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4349"}],"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=4349"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4349\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3732"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}