3

I'm developing a Unity plugin for an Android SDK. This SDK, in its native form, needs to receive onResume/pause notifications from the app in order to work properly. How can I get notifications for onResume/onPause from inside a Unity plugin? Thanks for your help!

1 Answer 1

5

You don't need an Android Unity plugin for onPause/onResume.

This unity callback is tied to Android's onPause/onResume callbacks. http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnApplicationPause.html

2
  • 1
    I already have the plugin. The plugin holds the native SDK which needs those notifications for its work. So I must get those notifications in the plugin or the host app and send them to the SDK. How do I translate MonoBehaviour.OnApplicationPause to onResume, onPause, onStart, onStop, onRestart?
    – Almog C
    Jan 27, 2014 at 16:22
  • In Unity 2017.3.0f3 I'm not always getting calls to OnApplicationPause when my Android Activity is resumed. The official documentation is ambiguous at best. Feb 28, 2018 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.