CLMonitor API Missing Geofence Entry Events After Initial Registration

We are experiencing a failure in CLMonitor event delivery when the application is launched into the background via an APNS (Remote Push Notification).

Even when a CLBackgroundActivitySession is instantiated immediately upon background launch, CLCircularGeographicCondition "Enter" events are suppressed. The system fails to deliver these events until the user manually brings the application to the Foreground. This indicates that CLBackgroundActivitySession does not correctly maintain background persistence when the session begins in a background state rather than transitioning from the foreground.

Comparison of API Behavior (Background State) Launch via APNS:

CLMonitor: Fails to trigger "Enter" events until the app is manually brought to the foreground.

Legacy API: Successfully triggers and delivers "Enter" events immediately upon background launch.

Exit Event Reliability:

CLMonitor: Reliably triggers exit events even in the background.

Legacy API: Reliably triggers exit events.

Foreground Dependency:

CLMonitor: Requires a foreground transition to "flush" or activate the delivery of pending entry events.

Legacy API: No foreground transition required; events are delivered directly to the background process.

Event Recovery:

CLMonitor: Relies on the developer re-instantiating the CLMonitor and awaiting the events stream, which appears to "stall" during warm-starts.

Legacy API: Relies on the CLLocationManagerDelegate which remains active as long as the manager instance exists.

Steps to Reproduce Preconditions:

Location Permissions: Set to "Always Allow".

Background Modes: "Location updates" and "Remote notifications" enabled.

App State: Terminated or Killed (by the user or the OS).

Reproduction Path:

Trigger Background Launch: Send a silent push notification (APNS) to wake the app in the background.

Initialize Session: Within the background launch sequence (e.g., didFinishLaunchingWithOptions), immediately create and hold a strong reference to a CLBackgroundActivitySession.

Register Monitor: * Initialize CLMonitor using requestMonitorWithConfiguration.

Add a geofence using addConditionForMonitoring with a CLCircularGeographicCondition.

Simulate Entry: Move the physical device (or simulate location) into the geofence boundary while the app remains in the background state.

Observe: No "Enter" event is received in the CLMonitor event stream.

Foreground Transition: Bring the app to the foreground.

Actual Result: The "Enter" event is only delivered the moment the app enters the Foreground.

Expected Result: The CLBackgroundActivitySession should enable CLMonitor to deliver "Enter" events immediately in the background, parity with the deprecated startMonitoringForRegion API.

Even when a CLBackgroundActivitySession is instantiated immediately upon background launch, CLCircularGeographicCondition "Enter" events are suppressed.

It's possible I'm overlooking something here, but what you're describing basically sounds like expected behavior. Quoting the CLBackgroundActivitySession class reference:

"Use CLBackgroundActivitySession to start a background activity session that allows a when-in-use authorized app to receive location updates or monitoring events."

A when-in-use session can extend "into" the background (for example, when you background a navigation app that's providing directions) but it cannot start in the background. Everything else you've described is in line with what I'd expect when a session isn't active.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

As per the Suggestion, Created CLBackgroundActivitySession and CLServiceSession in foreground to keep Core Location active. Recreated those sessions on background launch/APNS. Persisted and restored fence definitions so CLMonitor can re‑register fences after background launch.

But the restore only re‑registers fences that were already created before. If a fence is first created while the app is terminated and only launched in background, CLMonitor did not deliver the initial “enter” until a foreground session exists.

Comparision with old CLLocationManager region monitoring:

Old API (CLLocationManager region monitoring) is system‑managed. The OS keeps monitoring even when your app is terminated, and it can accept new region registrations in background because that API was designed around long‑standing background delivery.

New API (CLMonitor with CLBackgroundActivitySession/CLServiceSession) is session‑based. Apple expects the session to be created in foreground and then restored in background. It’s optimized for power and privacy, so first‑time background registration is not guaranteed; the system can defer or suppress events until the app has foreground‑initiated sessions.

Is there a modern API that reproduces the legacy CLLocationManager behavior of triggering an initial state event (Entry/Exit) while the app is in the background

CLMonitor API Missing Geofence Entry Events After Initial Registration
 
 
Q