File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1- import React , { useState } from 'react' ;
1+ import React , { useEffect , useState } from 'react' ;
2+ import { Platform } from 'react-native' ;
23import Dayjs from 'dayjs' ;
34import PropTypes from 'prop-types' ;
45
@@ -9,6 +10,8 @@ import { ChatContext, TranslationContext } from '../../context';
910import { themed } from '../../styles/theme' ;
1011import { Streami18n } from '../../utils/Streami18n' ;
1112
13+ import { version } from '../../../package.json' ;
14+
1215/**
1316 * Chat - Wrapper component for Chat. The needs to be placed around any other chat components.
1417 * This Chat component provides the ChatContext to all other components.
@@ -43,6 +46,10 @@ const Chat = (props) => {
4346 client,
4447 } ) ;
4548
49+ useEffect ( ( ) => {
50+ client . setUserAgent ( `stream-chat-react-native-${ Platform . OS } -${ version } ` ) ;
51+ } , [ ] ) ;
52+
4653 const setActiveChannel = ( channel ) => setChannel ( channel ) ;
4754
4855 if ( ! translators . t ) return null ;
You can’t perform that action at this time.
0 commit comments