diff --git a/app/mobile/package.json b/app/mobile/package.json index aa768ecf..b52aacc6 100644 --- a/app/mobile/package.json +++ b/app/mobile/package.json @@ -18,6 +18,7 @@ "axios": "^1.1.0", "expo": "~46.0.9", "expo-av": "^12.0.4", + "expo-keep-awake": "~10.2.0", "expo-splash-screen": "~0.16.2", "expo-status-bar": "~1.4.0", "moment": "^2.29.4", diff --git a/app/mobile/src/session/conversation/Conversation.jsx b/app/mobile/src/session/conversation/Conversation.jsx index fbb630d8..c149b172 100644 --- a/app/mobile/src/session/conversation/Conversation.jsx +++ b/app/mobile/src/session/conversation/Conversation.jsx @@ -1,4 +1,5 @@ import { KeyboardAvoidingView, Modal, Platform, TextInput, View, TouchableOpacity, Text, } from 'react-native'; +import { activateKeepAwake, deactivateKeepAwake } from 'expo-keep-awake'; import { FlatList, ScrollView } from '@stream-io/flat-list-mvcp'; import { memo, useState, useRef, useEffect } from 'react'; import { useConversation } from './useConversation.hook'; @@ -38,6 +39,11 @@ export function ConversationBody() { const ref = useRef(); + useEffect(() => { + activateKeepAwake(); + return () => { deactivateKeepAwake() }; + }, []); + const latch = () => { if (!state.momentum) { actions.latch();