xref: /expo/packages/expo-task-manager/plugin/src/withTaskManager.ts (revision 98f365fa)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import { ConfigPlugin, createRunOncePlugin, withInfoPlist } from 'expo/config-plugins';
2
3const pkg = require('expo-task-manager/package.json');
4
5const withTaskManager: ConfigPlugin = (config) => {
6  config = withInfoPlist(config, (config) => {
7    if (!Array.isArray(config.modResults.UIBackgroundModes)) {
8      config.modResults.UIBackgroundModes = [];
9    }
10    if (!config.modResults.UIBackgroundModes.includes('fetch')) {
11      config.modResults.UIBackgroundModes.push('fetch');
12    }
13    return config;
14  });
15
16  return config;
17};
18
19export default createRunOncePlugin(withTaskManager, pkg.name, pkg.version);
20

served by {OpenGrok

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