iosswiftpush-notificationlocationcore-location

iOS Location Push Service Extension. CLLocationPushServiceErrorDomain Code: 1


I'm following Apple guidelines to add the Location Push Service Extension to my app.

I followed these steps:

  1. I applied and got approved for Location Push Service Extension.
  2. I added the entitlement key com.apple.developer.location.push = TRUE
  3. I added to the project a new Target, and selected Location Push Service Extension from the iOS Application Extension group

Now I encouter the following issue. When I run the app and call this function

startMonitoringLocationPushes(completion:)

I receive the following error:

Error Domain=CLLocationPushServiceErrorDomain Code=1 "(null)"

By looking at Apple documentation for CLLocationPushServiceErrorDomain, code 1 stands for:

missingPushExtension An error code that indicates the app is missing a Location Push Service Extension.

As mentioned beofore I already added the Location Service Extension Target to the project. Any idea of why I receive this error?

Thanks


Solution

  • After trial and error, I figured out what the issue was. The deployment target of the Location Push Service Extension was set automatically to the latest iOS version (16.4 at the time of this post), but the device where it was built had a previous version of iOS.

    I fixed it by changing the General > Deployment Info on the Location Push Service Extension Target to iOS 15.0 (minimum iOS requirement for this feature).

    enter image description here