Fixes application going to background (inactive) and back to foreground (active) on iOS