-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
20 lines (18 loc) · 866 Bytes
/
Copy pathindex.js
File metadata and controls
20 lines (18 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
* Custom entry point.
*
* react-native-android-widget requires `registerWidgetTaskHandler` to be
* called at startup so that Android can invoke the handler as a headless JS
* task when the app is closed. Expo Router normally owns the entry via the
* "main": "expo-router/entry" shorthand; we replace that shorthand here and
* import expo-router/entry manually after registering the handler.
*
* package.json → "main": "./index.js"
*/
import { registerWidgetTaskHandler } from 'react-native-android-widget';
import { widgetTaskHandler } from './src/widgetTaskHandler';
// Register before expo-router bootstraps the React app so the handler is
// available for headless task invocations from the moment the JS engine starts.
registerWidgetTaskHandler(widgetTaskHandler);
// Hand off to Expo Router for everything else.
import 'expo-router/entry';