@@ -135,12 +135,13 @@ export const ChannelIO = {
135
135
} ,
136
136
137
137
/**
138
- * Opens User chat to run a specific Support bot.
139
- * @param {String } supportBotId This is the support bot's ID. If supportBotId is invalid or nil, the chat room is closed.
140
- * @param {String } message This message will be displayed in the input field after completing the support bot operation.
138
+ * Opens a user chat and starts the specified workflow.
139
+ * - If a corresponded workflow with the provided workflowId is exists, it will be executed. if workflowId is invalid, an error page is displayed.
140
+ * - If you don't pass workflowId, no action is taken.
141
+ * @param {String } workflowId The ID of workflow to start with. An error page will be shown if such workflow does not exist.
141
142
*/
142
- openSupportBot : ( supportBotId , message ) => {
143
- ChannelModule . openSupportBot ( supportBotId , message ) ;
143
+ openWorkflow : ( workflowId ) => {
144
+ ChannelModule . openWorkflow ( workflowId ) ;
144
145
} ,
145
146
146
147
/**
@@ -231,13 +232,17 @@ export const ChannelIO = {
231
232
openStoredPushNotification : ( ) => ChannelModule . openStoredPushNotification ( ) ,
232
233
233
234
/**
234
- * Set page to be used instead of recent activity name or view controller.
235
+ * Sets the name of the screen along with user chat profile. If track is called before setPage, the event will not reflect the page information.
236
+ * @param {String } page This is the screen name when track is called. When calling .track(), the event's page is set to null.
237
+ * @param {String } profile The user chat profile value.
238
+ * - When nil is assigned to a specific field within the profile object, only the value of that field is cleared.
239
+ * - The user chat profile value is applied when a user chat is created.
235
240
*/
236
- setPage : ( page ) => {
241
+ setPage : ( page , profile ) => {
237
242
if ( typeof page === "string" ) {
238
- ChannelModule . setPage ( page )
243
+ ChannelModule . setPage ( page , profile )
239
244
} else if ( page === null || page === undefined ) {
240
- ChannelModule . setPage ( null )
245
+ ChannelModule . setPage ( null , profile )
241
246
} else {
242
247
console . error ( 'ChannelIO' , '"page" must be type of "string", null or undefined.' )
243
248
}
@@ -260,6 +265,11 @@ export const ChannelIO = {
260
265
}
261
266
} ,
262
267
268
+ /**
269
+ * Hides the Channel popup on the global screen.
270
+ */
271
+ hidePopup : ( ) => ChannelModule . hidePopup ( ) ,
272
+
263
273
/**
264
274
* @deprecated
265
275
* Event listener that triggers when badge count has been changed
0 commit comments