title: How to detect what triggered applicationWillResignActive?
body: <p>I have a Video Chat application that I want to disconnect from a call when the device is locked, but stay connected when an SMS, calendar, low battery or any other type of notification is received. The problem is, I cannot figure out for the life of me how to determine what causes my app delegate's applicationWillResignActive selector to be called.</p>
  
  <p>I have thought about implementing some kind of timeout where if applicationDidBecomeActive was not called within a certain number of seconds I would disconnect but that falsely assumes that a user will ignore or accept a received notification within that number of seconds.</p>
  
  <p>Can anyone help me figure out a way to determine what caused the applicationWillResignActive selector to be called?</p>
  
  <p>Many Thanks,
  Mason </p>