- Home /
Android Background Service Plugin Development (Unity Free)
I'm developing a simple android/iOS app that requires background services to run while the app has either been closed or "hidden".
I need to simply compare a DateTime variable to the current device time (alarm clock) then open my application up and run some processes then sleep again until notified again. I've been watching this tutorial on unity plugin development and noticed the instructor stating that it's not possible to develop native plugins with the free version of unity and that will require the pro version. I've searched more on this for more details and came up empty handed. Can anyone clarify this?
Answer by nintendaii · Feb 24, 2021 at 02:17 PM
Hi, here is a good example of unity app with background service https://github.com/nintendaii/unity-background-service
Answer by kamran-bigdely · Apr 13, 2017 at 12:42 PM
There is no difference between pro and free version of Unity in that regard. What he said was right couple years ago but then Unity Technologies changed its policy.
Answer by gfoot · Apr 13, 2017 at 12:02 AM
I think that's out of date, but you don't need a native plugin anyway. It's easiest to do this using an Android Javascript plugin, which you need to launch as a service when your app is started. This then runs in the background even when your app is terminated, and can do things like display notifications to the user.
I'm not sure whether it's possible to auto-launch your app again, but it's not something I'd recommend in any case as users do not expect it, it is very intrusive. Typically if any processing needed to be done, you'd do it in the Javascript, which is much more lightweight than firing up a Unity-based app.
Here's a good example of how to build a jar plugin and use it from Unity: https://github.com/Agasper/unity-android-notifications
Your answer
Follow this Question
Related Questions
Create a ListView in Unity Android app: use UnityGUI or Android plugin? 0 Answers
Android obfuscator 1 Answer
YouTube Player Fragment in Plugin 1 Answer
Where can I find the resource definition for google play games android configuration? 1 Answer
Are all DLL files pre-loaded at game start up or loaded when needed? 0 Answers