Android back button not registering

I am trying to program the back button for my android app. I am using a Nexus 4 updated to the latest Android build.

I have tried using GetKey(Keycode.Escape) and GetKeyDown(Keycode.escape) but neither work. The back button is working when I am running the app over UnityRemote, but when I build to my phone it just quits the app. I have tried calling the GetKey methods in Update and OnGUI.

I think you should use a plugin for that. Since, Unity does not provide that functionality, you should implement it. Read

  1. How to get the back button event on Android. This is in Java. Then you should create a plugin with that code. And all the settings
  2. And see this: How to build plugins for Android.