Add onAppBackground/Foreground methods