NEHotspotHelper make app live too long on background ?

Hello, I recently encountered a tricky problem:

+ (BOOL)registerWithOptions:(nullable NSDictionary<NSString *,NSObject *> *)options
					  queue:(dispatch_queue_t)queue
					handler:(NEHotspotHelperHandler)handler

NEHotspotHelper handler make our app live in the background for a long time. And the running time of the app in the background far exceeds the running time of the foreground. Our application reported the content of the metric payload, and the statistics data of some users are as follows: ForegroundTime is 0 ,BackgroundTime: almost 3 hours, audiotime is 0 LocationTime is 0

I would like to ask about NEHotspotHelper details: How NEHotspotHelper make the app live in the background. How to limit the App background live time triggered by hotspot.

It’s a rare occurence that developers complain about their app running too much in the background (-:

When evaluating this issue, you have to distinguish between three different factors:

  • The amount of time that your app was launched.

  • The amount of time that your app ran. If an app gets suspended, it’s launched but not running.

  • The amount of CPU time that your app used. If an app is running but all of its threads are suspended, it’s not using any CPU time.

As a hotspot helper you have no control over the first factor, limited control over the second, and a lot of control over the third.

Before going further, I want to ask about how reproducible this is. Are you seeing this behaviour in your internal tests? Or only in reports coming from your users?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

When it comes to duration, our situation is as follows: Users have observed in the Settings app that our app sometimes runs for a short period in the foreground but stays active in the background for an extended time. This leads to discomfort and confusion among users. Therefore, we wish to limit the displayed background running time in the Settings app.

NEHotspotHelper make app live too long on background ?
 
 
Q