- Home /
App in background still receive UnityPlayer.UnitySendMessage from Android plugin, normal ?
Hi,
I'm working on a background geolocation plugin for an Unity App.
Basicly my plugin send geolocation updates to the App in order to display user position on a map and record a gps track.
I'm using this code to send back location to the Unity App:
UnityPlayer.UnitySendMessage("GeolocationService", "geolocationChanged", location2JsonString(location));
It seems like that the Unity app receive and execute "geolocationChanged()" even if the app is in background, it's perfect for my usecase, but I'm a little bit surprised by this behaviour.
I was thinking that while the app is in background it was not going to receive the UnitySendMessage request because it is paused. And that I would have to store the missed location in an Array on the android side in order to get the missed values when the OnPause(false) event is fired.
Is it a normal behaviour that the UnitySendMessage is received and executed even if the App is in background ?
Thanks !
Duke
Hi Duke, I'm interesting in background geolocation plugin for Unity . Is it possible to share this plugin? or can buy it on asset store? Thanks.
Hi, i am trying to disconnect from the server my app when it go to background, and i call the unitysendmessage and in c# it isn't executed until i open again my app. I am trying to do what you say but in my case it isn't working. I don't know what it is normal.
I am having the opposite behavior too. Unity function isn't executed until I bring the unity app in foreground. What is the normal?