@@ -29,6 +29,7 @@ import {
2929 COLLECTION_ID ,
3030 SEARCH_TERM ,
3131 TOKEN ,
32+ CONVERSATION_ID ,
3233} from './constants' ;
3334
3435import Button from './components/Button' ;
@@ -48,6 +49,9 @@ export default function App() {
4849 const [ launcherVisibility , setLauncherVisibility ] = useState < boolean > ( false ) ;
4950 const [ user , setUser ] = useState < UserAttributes > ( { email : '' } ) ;
5051
52+ const [ conversationId , setConversationId ] = useState < string | undefined > (
53+ CONVERSATION_ID
54+ ) ;
5155 const [ articleId , setArticleId ] = useState < string | undefined > ( ARTICLE_ID ) ;
5256 const [ carouselId , setCarouselId ] = useState < string | undefined > ( CAROUSEL_ID ) ;
5357 const [ surveyId , setSurveyId ] = useState < string | undefined > ( SURVEY_ID ) ;
@@ -90,6 +94,7 @@ export default function App() {
9094 Intercom . setInAppMessageVisibility ( Visibility . VISIBLE ) . then ( ( ) =>
9195 setInAppMessageVisibility ( true )
9296 ) ;
97+ setConversationId ( CONVERSATION_ID ) ;
9398 setArticleId ( ARTICLE_ID ) ;
9499 setCarouselId ( CAROUSEL_ID ) ;
95100 setSurveyId ( SURVEY_ID ) ;
@@ -282,7 +287,29 @@ export default function App() {
282287 } ) ;
283288 } }
284289 />
285-
290+ < Input
291+ title = "Conversation Id"
292+ accessibilityLabel = "conversation-id"
293+ value = { conversationId }
294+ onChangeText = { ( val ) => {
295+ setConversationId ( val ) ;
296+ } }
297+ placeholder = "Conversation Id"
298+ />
299+ < Button
300+ intercom_accessibilityLabel = "present-conversation"
301+ intercom_disabled = { ! loggedUser }
302+ intercom_title = "Display Conversation"
303+ intercom_onPress = { ( ) => {
304+ if ( conversationId ) {
305+ let conversationContent =
306+ IntercomContent . conversationWithConversationId ( conversationId ) ;
307+ Intercom . presentContent ( conversationContent ) ;
308+ } else {
309+ showEmptyAlertMessage ( 'Conversation Id' ) ;
310+ }
311+ } }
312+ />
286313 < Input
287314 title = "Article Id"
288315 accessibilityLabel = "article-id"
0 commit comments