Clarified app delegate methods with comments and changed state == background to state == inactive. Background is only if our app does background processes. Inactive is if the app has been navigated away from.