Add onAppBackground/Foreground events