xref: /expo/packages/expo-task-manager/plugin/src/withTaskManager.ts (revision 7e58fb75)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import { ConfigPlugin, createRunOncePlugin } from '@expo/config-plugins';
2
3const pkg = require('expo-task-manager/package.json');
4
5const withTaskManager: ConfigPlugin = config => {
6  if (!config.ios) config.ios = {};
7  if (!config.ios.infoPlist) config.ios.infoPlist = {};
8  if (!config.ios.infoPlist.UIBackgroundModes) config.ios.infoPlist.UIBackgroundModes = [];
9
10  // TODO: Maybe entitlements are needed
11  config.ios.infoPlist.UIBackgroundModes = [
12    ...new Set(config.ios.infoPlist.UIBackgroundModes.concat(['location', 'fetch'])),
13  ];
14
15  return config;
16};
17
18export default createRunOncePlugin(withTaskManager, pkg.name, pkg.version);
19

served by {OpenGrok

Last Index Update: Tue Oct 21 18:42:31 GMT 2025