L
L
LittleBob2022-02-06 14:23:02
Unity
LittleBob, 2022-02-06 14:23:02

How to make app work in Unity background?

In android, you can minimize the application, but how to make sure that it continues to work.
For example, so that the sound continues to work and is placed in the notification shade.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mimocodil, 2022-02-06
@LittleBob

Unity Android sees applications as a normal Activity. By minimizing the application, you pause the Activity. Android is free to close all paused applications at will, even Application.runInBackground does not work (in iOS too). A solution that will help you: write a service in Java / Kotlin and then start it when minimizing / closing it and stop it when you open the application.
Check out this GitHub project: https://github.com/nintendaii/unity-background-service

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question