Over 11,000 five-star assets

Rated by 85,000+ customers

Supported by 100,000+ forum members

Every asset moderated by Unity

Home
Tools
Utilities
1/2
Task Invoker - Run C# code while your mobile app is in the background.
Render pipeline compatibility
The Built-in Render Pipeline is Unity’s default render pipeline. It is a general-purpose render pipeline that has limited options for customization. The Universal Render Pipeline (URP) is a Scriptable Render Pipeline that is quick and easy to customize, and lets you create optimized graphics across a wide range of platforms. The High Definition Render Pipeline (HDRP) is a Scriptable Render Pipeline that lets you create cutting-edge, high-fidelity graphics on high-end platforms.
Unity VersionBuilt-inURPHDRP
2020.3.0f1
Compatible
Compatible
Compatible
Description

Features

  • Runs C# code while the app is in the background
  • Invokes a C# callback on a configurable interval
  • Supports Android and iOS
  • Runs on the Unity main thread so Unity components can be accessed as usual
  • Includes utilities for wrapping UnityWebRequests with tasks so that they keep running even if the app is sent to the background

Compatibility

  • Unity Editor 2017 or newer
  • Android devices supported by Unity 2017 or newer
  • iOS devices supported by Unity 2017 or newer

Additional Notes

  • These tasks are meant for light background work, not for running the whole game in the background.
  • Tasks will not run indefinitely: the tasks will stop running if the app is killed by the user or the OS. Please view the technical details below for more info.

Links


Technical details

iOS details

The iOS plugin uses beginBackgroundTaskWithExpirationHandler to run the background tasks. Because of this the tasks will expire usually after around a half minute of background run time. The Expired event in TaskInvoker class can be used to handle expired tasks.


Android details

On older Android versions the tasks run as long as the app is not killed by the user. But newer versions like Android 14 have more strict battery usage settings. By default apps are in balanced mode that limits the background time to around 10 minutes. The time may vary based on the device and usage.

Task Invoker - Mobile Background Tasks

(8)
43 users have favourite this asset
(43)
$24
Seat
1
Updated price and taxes/VAT calculated at checkout
Refund policy
This asset is covered by the Unity Asset Store Refund Policy. Please see section 2.9.3 of the EULA for details.
Secure checkout:
Supported payment methods: Visa, Mastercard, Maestro, Paypal, Amex
License type
File size
133.7 KB
Latest version
1.0.2
Latest release date
Jun 20, 2023
Original Unity version
2020.3.0
Support
Visit site
Quality assets
Over 11,000 five-star assets
Trusted
Rated by 85,000+ customers
Community support
Supported by 100,000+ forum members
Unity logo
Language
Feedback
Partners Program
Partners
USD
EUR
Copyright © 2025 Unity Technologies
All prices are exclusive of tax
USD
EUR
$24