@@ -188,24 +188,12 @@ interface RNChannelIO extends Pick<ChannelModuleType,
188188 | 'resetPage'
189189 | 'setAppearance'
190190 | 'hidePopup' > {
191- show : ( animated : boolean ) => void ;
192- hide : ( animated : boolean ) => void ;
193- open : ( animated : boolean ) => void ;
194- close : ( animated : boolean ) => void ;
195- handlePushNotification : ( userInfo : Record < string , any > ) => Promise < void > ;
196- onChangeBadge : ( cb ?: ( unread : number , alert : number ) => void ) => void ;
197191 onBadgeChanged : ( cb ?: ( unread : number , alert : number ) => void ) => void ;
198- onReceivePush : ( cb ?: ( popup : PopupData ) => void ) => void ;
199192 onPopupDataReceived : ( cb ?: ( popup : PopupData ) => void ) => void ;
200- onClickChatLink : ( handle : boolean , cb ?: ( url : string ) => void ) => void ;
201193 onUrlClicked : ( cb ?: ( url : string , next : ( ) => void ) => void ) => void ;
202- onChangeProfile : ( cb ?: ( ) => void ) => void ;
203- onProfileChanged : ( cb ?: ( data : Record < string , any > ) => void ) => void ;
204194 onFollowUpChanged : ( cb ?: ( data : Record < string , any > ) => void ) => void ;
205195 onPushNotificationClicked : ( cb ?: ( chatId : string , next : ( ) => void ) => void ) => void ;
206- willShowMessenger : ( cb ?: ( ) => void ) => void ;
207196 onShowMessenger : ( cb ?: ( ) => void ) => void ;
208- willHideMessenger : ( cb ?: ( ) => void ) => void ;
209197 onHideMessenger : ( cb ?: ( ) => void ) => void ;
210198 onChatCreated : ( cb ?: ( chatId : string ) => void ) => void ;
211199}
@@ -275,57 +263,21 @@ export const ChannelIO: RNChannelIO = {
275263 ChannelModule . shutdown ( ) ;
276264 } ,
277265
278- /**
279- * @deprecated
280- * Show `ChannelIO` button
281- * @param {Boolean } aniamted Animate the launcher if true
282- */
283- show : ( animated : boolean ) => {
284- console . log ( 'ChannelIO' , 'ChannelIO.show(animated) is deprecated. Please use ChannelIO.showChannelButton()' )
285- ChannelModule . showChannelButton ( )
286- } ,
287266 /**
288267 * Show `ChannelIO` button
289268 */
290269 showChannelButton : ( ) => ChannelModule . showChannelButton ( ) ,
291270
292- /**
293- * @deprecated
294- * Hide `ChannelIO` button
295- * @param {Boolean } aniamted Animate the launcher if true
296- */
297- hide : ( animated : boolean ) => {
298- console . log ( 'ChannelIO' , 'ChannelIO.hide(animated) is deprecated. Please use ChannelIO.hideChannelButton()' )
299- ChannelModule . hideChannelButton ( )
300- } ,
301271 /**
302272 * Hide `ChannelIO` button
303273 */
304274 hideChannelButton : ( ) => ChannelModule . hideChannelButton ( ) ,
305275
306- /**
307- * @deprecated
308- * Open `ChannelIO` messenger
309- * @param {Boolean } aniamted Animate messenger if true
310- */
311- open : ( animated : boolean ) => {
312- console . log ( 'ChannelIO' , 'ChannelIO.open(animated) is deprecated. Please use ChannelIO.showMessenger()' )
313- ChannelModule . showMessenger ( )
314- } ,
315276 /**
316277 * Show `ChannelIO` messenger
317278 */
318279 showMessenger : ( ) => ChannelModule . showMessenger ( ) ,
319280
320- /**
321- * @deprecated
322- * Close `ChannelIO` messenger
323- * @param {Boolean } Animate messenger if true
324- */
325- close : ( animated : boolean ) => {
326- console . log ( 'ChannelIO' , 'ChannelIO.close(animated) is deprecated. Please use ChannelIO.hideMessenger()' )
327- ChannelModule . hideMessenger ( )
328- } ,
329281 /**
330282 * Hide `ChannelIO` messenger
331283 */
@@ -418,15 +370,6 @@ export const ChannelIO: RNChannelIO = {
418370 */
419371 isChannelPushNotification : async ( userInfo : Record < string , any > ) => ChannelModule . isChannelPushNotification ( userInfo ) ,
420372
421- /**
422- * @deprecated
423- * Handle `ChannelIO` push notification
424- * @param {Object } userInfo userInfo part from push data
425- */
426- handlePushNotification : async ( userInfo : Record < string , any > ) => {
427- console . log ( 'ChannelIO' , 'ChannelIO.handlePushNotification(userInfo) is deprecated. Please use ChannelIO.receivePushNotification(userInfo)' )
428- ChannelModule . receivePushNotification ( userInfo )
429- } ,
430373 /**
431374 * Receive `ChannelIO` push notification
432375 * @param {Object } userInfo userInfo part from push data
@@ -483,23 +426,6 @@ export const ChannelIO: RNChannelIO = {
483426 */
484427 hidePopup : ( ) => ChannelModule . hidePopup ( ) ,
485428
486- /**
487- * @deprecated
488- * Event listener that triggers when badge count has been changed
489- * @param {Function } cb a callback function that takes a integer badge count as parameter
490- */
491- onChangeBadge : ( cb ?: ( unread : number , alert : number ) => void ) => {
492- console . log ( 'ChannelIO' , 'ChannelIO.onChangeBadge(cb) is deprecated. Please use ChannelIO.onBadgeChanged(cb)' )
493- if ( cb ) {
494- const subscription = ChannelEventEmitter ?. addListener ( ChannelModule . Event . ON_BADGE_CHANGED , ( data ) => {
495- cb ( data . unread , data . alert ) ;
496- } ) ;
497- replaceSubscriber ( ChannelModule . Event . ON_BADGE_CHANGED , subscription ) ;
498- } else {
499- replaceSubscriber ( ChannelModule . Event . ON_BADGE_CHANGED , null ) ;
500- }
501-
502- } ,
503429 /**
504430 * Event listener that triggers when badge count has been changed
505431 * @param {Function } cb a callback function that takes a integer badge count as parameter
@@ -515,22 +441,6 @@ export const ChannelIO: RNChannelIO = {
515441 }
516442 } ,
517443
518- /**
519- * @deprecated
520- * Event listener that triggers when in-app popup has been arrived
521- * @param {Function } cb a callback function that takes a object popup data as parameter
522- */
523- onReceivePush : ( cb ?: ( popup : PopupData ) => void ) => {
524- console . log ( 'ChannelIO' , 'ChannelIO.onReceivePush(cb) is deprecated. Please use ChannelIO.onPopupDataReceived(cb)' )
525- if ( cb ) {
526- const subscription = ChannelEventEmitter ?. addListener ( ChannelModule . Event . ON_POPUP_DATA_RECEIVED , ( data ) => {
527- cb ( data . popup ) ;
528- } ) ;
529- replaceSubscriber ( ChannelModule . Event . ON_POPUP_DATA_RECEIVED , subscription ) ;
530- } else {
531- replaceSubscriber ( ChannelModule . Event . ON_POPUP_DATA_RECEIVED , null ) ;
532- }
533- } ,
534444 /**
535445 * Event listener that triggers when in-app popup has been arrived
536446 * @param {Function } cb a callback function that takes a object popup data as parameter
@@ -546,25 +456,6 @@ export const ChannelIO: RNChannelIO = {
546456 }
547457 } ,
548458
549- /**
550- * @deprecated
551- * Event listener that triggers when a link has been clicked by a user
552- * @param {Boolean } handle True if you want to handle a link, otherwise false
553- * @param {Function } cb a callback function that takes a string url as parameter
554- */
555- onClickChatLink : ( handle : boolean , cb ?: ( url : string ) => void ) => {
556- console . log ( 'ChannelIO' , 'ChannelIO.onClickChatLink(handle, cb) is deprecated. Please use ChannelIO.onUrlClicked(cb)' )
557- if ( cb ) {
558- replaceSubscriber ( ChannelModule . Event . ON_URL_CLICKED , ( data ) => {
559- if ( ! handle ) {
560- ChannelModule . handleUrlClicked ( data . url ) ;
561- }
562- cb ( data . url ) ;
563- } ) ;
564- } else {
565- replaceSubscriber ( ChannelModule . Event . ON_URL_CLICKED , null ) ;
566- }
567- } ,
568459 /**
569460 * Event listener that triggers when a url has been clicked by a user
570461 * @param {Function } cb a callback function that takes a string url as parameter
@@ -580,23 +471,7 @@ export const ChannelIO: RNChannelIO = {
580471 } else {
581472 replaceSubscriber ( ChannelModule . Event . ON_URL_CLICKED , null ) ;
582473 }
583- } ,
584-
585- /**
586- * @deprecated
587- * 'onChangeProfile' is deprecated. Please use 'onFollowUpChanged'.
588- */
589- onChangeProfile : ( cb ?: ( ) => void ) => {
590- console . warn ( "'onChangeProfile' is deprecated. Please use 'onFollowUpChanged'." )
591- } ,
592-
593- /**
594- * @deprecated
595- * 'onProfileChanged' is deprecated. Please use 'onFollowUpChanged'.
596- */
597- onProfileChanged : ( cb ?: ( data : Record < string , any > ) => void ) => {
598- console . warn ( "'onProfileChanged' is deprecated. Please use 'onFollowUpChanged'." )
599- } ,
474+ } ,
600475
601476 /**
602477 * Event listener that triggers when guest profile is updated
@@ -638,20 +513,6 @@ export const ChannelIO: RNChannelIO = {
638513 }
639514 } ,
640515
641- /**
642- * @deprecated
643- * Event listener that triggers when `ChannelIO` messenger is about to display
644- * @param {Function } cb a callback function
645- */
646- willShowMessenger : ( cb ?: ( ) => void ) => {
647- console . log ( 'ChannelIO' , 'ChannelIO.willShowMessenger(cb) is deprecated. Please use ChannelIO.onShowMessenger(cb)' )
648- if ( cb ) {
649- const subscription = ChannelEventEmitter ?. addListener ( ChannelModule . Event . ON_SHOW_MESSENGER , cb ) ;
650- replaceSubscriber ( ChannelModule . Event . ON_SHOW_MESSENGER , subscription ) ;
651- } else {
652- replaceSubscriber ( ChannelModule . Event . ON_SHOW_MESSENGER , null ) ;
653- }
654- } ,
655516 /**
656517 * Event listener that triggers when `ChannelIO` messenger is about to display
657518 * @param {Function } cb a callback function
@@ -665,20 +526,6 @@ export const ChannelIO: RNChannelIO = {
665526 }
666527 } ,
667528
668- /**
669- * @deprecated
670- * Event listener that triggers when `ChannelIO` messenger is about to dismiss
671- * @param {Function } cb a callback function
672- */
673- willHideMessenger : ( cb ?: ( ) => void ) => {
674- console . log ( 'ChannelIO' , 'ChannelIO.willHideMessenger(cb) is deprecated. Please use ChannelIO.onHideMessenger(cb)' )
675- if ( cb ) {
676- const subscription = ChannelEventEmitter ?. addListener ( ChannelModule . Event . ON_HIDE_MESSENGER , cb ) ;
677- replaceSubscriber ( ChannelModule . Event . ON_HIDE_MESSENGER , subscription ) ;
678- } else {
679- replaceSubscriber ( ChannelModule . Event . ON_HIDE_MESSENGER , null ) ;
680- }
681- } ,
682529 /**
683530 * Event listener that triggers when `ChannelIO` messenger is about to dismiss
684531 * @param {Function } cb a callback function
0 commit comments