From 711b5ef0a6f9894713ef1e80ba47490c16d3bda7 Mon Sep 17 00:00:00 2001 From: Harjot Singh Date: Sat, 20 Apr 2024 02:13:32 +0100 Subject: [PATCH] feat: keep device awake --- config/app.ts | 8 ++++---- package-lock.json | 1 + package.json | 3 ++- src/index.ts | 3 +++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config/app.ts b/config/app.ts index 9116c716..dfcf61ac 100644 --- a/config/app.ts +++ b/config/app.ts @@ -34,15 +34,15 @@ export default { package: build.bundleId, }, plugins: [ + [ 'app-icon-badge', { + enabled: !!build.banner, + badges: [ { text: build.banner, type: 'banner' } ], + } ], 'expo-router', 'expo-localization', [ 'expo-screen-orientation', { initialOrientation: 'DEFAULT' } ], [ 'expo-dev-launcher' ], [ 'expo-font', { fonts } ], - [ 'app-icon-badge', { - enabled: !!build.banner, - badges: [ { text: build.banner, type: 'banner' } ], - } ], ], experiments: { typedRoutes: true, diff --git a/package-lock.json b/package-lock.json index 133c4114..3afa7a57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "expo-device": "~5.9.4", "expo-file-system": "~16.0.8", "expo-font": "~11.10.3", + "expo-keep-awake": "~12.8.2", "expo-linear-gradient": "~12.7.2", "expo-linking": "~6.2.2", "expo-localization": "~14.8.4", diff --git a/package.json b/package.json index 2d1485bc..c9663ebe 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,8 @@ "react-native-safe-area-context": "4.8.2", "react-native-screens": "~3.29.0", "ts-pattern": "^5.1.1", - "type-fest": "^4.15.0" + "type-fest": "^4.15.0", + "expo-keep-awake": "~12.8.2" }, "devDependencies": { "@babel/core": "^7.24.4", diff --git a/src/index.ts b/src/index.ts index b6a64d2e..3b18611c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,9 @@ import 'expo-router/entry' import 'react-native-gesture-handler' +import { activateKeepAwakeAsync } from 'expo-keep-awake' + import * as i18n from '~/services/i18n' void i18n.initialize() +void activateKeepAwakeAsync()