How can I tell my app is launched via BGAppRefreshTask/BGProcessTask?

I need to know if my app is launched via BGAppRefreshTask/BGProcessTask in UIApplicationDelegate's application:didFinishLaunchingWithOptions: method, but the launchOptions didn't contain any key about this.

A workaround is to check if UIApplication sharedApplication].applicationState == UIApplicationStateBackground in application:didFinishLaunchingWithOptions:, but it cannot tell launch via BGTask part from launch via other methods like silent push.

Wondering the same. It would be nice to know during didFinishLaunchingWithOptions that app was launched because of BGAppRefresh or BGProcessing task.

How can I tell my app is launched via BGAppRefreshTask/BGProcessTask?
 
 
Q