app 状态解释 & push执行情况

来源:互联网 发布:最美乡村网络评选活动 编辑:程序博客网 时间:2024/06/06 08:33

  • UIApplicationStateActive 
  • The app is running in the foreground and currently receiving events. 
  • 在前台
  • UIApplicationStateInactive 
  • The app is running in the foreground but is not receiving events. This might happen as a result of an interruption or because the app is transitioning to or from the background. 
  • 前后台过渡阶段
  • UIApplicationStateBackground
  • The app is running in the background. 
  • 在后台


push执行情况:

收到push的两种情况
一:收到push的时候程序正好在前台,直接执行receivePush方法。
二:收到push程序不在前台(可能后台,可能杀死状态。。),弹出push通知。
点击push通知的两种情况
一:程序还活着(可能是前台状态,可能是后台状态。。):点击push通知会执行receivePush方法。
二:程序被杀死了:点击push会执行didFinishLaunchingWithOptions,但是却不会执行receivePush方法,需要在didFinishLaunchingWithOptions方法里边手动去执行。。
0 0
原创粉丝点击