fix(ios): remove usage of APIs deprecated in iOS 14 and iOS 15 - #163
Merged
Conversation
Geolocation: replace the `CLLocationManager.authorizationStatus()` class method, deprecated in iOS 14, with the `authorizationStatus` instance property. `checkPermission()` stays static and reads the status from a type-level `CLLocationManager`, so callers are unchanged and no manager is allocated per permission check. The `.authorized` case is dropped as well, since it is the legacy alias of `.authorizedAlways` and matches the same raw value. Notifications: stop setting `summaryArgument` on `UNMutableNotificationContent`. It is deprecated since iOS 15 and the system ignores the value. The `summaryArgument` schedule option is kept and marked as deprecated instead of removed, so the public API does not break. `groupSummary` is also dropped from the iOS `NotificationOption`, where it was parsed but never used; Android keeps its own model and is unaffected.
🦋 Changeset detectedLatest commit: 6b73444 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
andredestro
requested review from
ItsChaceD,
OS-pedrogustavobilro,
OS-ruimoreiramendes,
alexgerardojacinto,
jcesarmobile,
markemer and
theproducer
August 20, 2026 17:16
alexgerardojacinto
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the iOS 14 and iOS 15 deprecation warnings in the geolocation and notifications code (RMET-5363). A clean
xcodebuildof the plugin emitted four of them:Geolocation
CLLocationManager.authorizationStatus()is deprecated in iOS 14 in favour of theauthorizationStatusinstance property (API_DEPRECATED_WITH_REPLACEMENT("-authorizationStatus", ios(4.2, 14.0))), so this is a direct replacement with no behaviour change.initandrequestPermission()read the status from the instance's ownlocationManager.checkPermission()staysstatic, so it reads from a type-levelCLLocationManager. This keeps the callers unchanged and avoids allocating a manager on every permission check (it runs on everygetCurrentPosition()/startWatchingPosition()call coming from JS)..authorizedcase from the switch: it is the legacy alias of.authorizedAlwayswith the same raw value, anddefaultalready covers unknown values.Notifications
summaryArgumentonUNMutableNotificationContentis deprecated since iOS 15 and the value is ignored by the system, so it is no longer set on the notification content.The
summaryArgumentschedule option is not removed from the public API. It is marked as@deprecatedwith a note that it has no effect, so no app breaks at build time over an option the OS discards anyway. Docs were regenerated withdocgen.groupSummaryis also dropped from the iOSNotificationOption: it was parsed and never used. The option keeps working on Android, which has its own model.Out of scope
The build still reports one non-deprecation warning,
capture of 'self' with non-Sendable type 'CapacitorGeolocation' in a '@Sendable' closure(Geolocation.swift:88), left untouched on purpose. It becomes an error under the Swift 6 language mode and deserves its own change.Verification
xcodebuild -scheme CapacitorBackgroundRunner -destination 'generic/platform=iOS': BUILD SUCCEEDED, nodeprecatmatch anywhere in the full log.xcodebuild teston an iPhone 17 Pro simulator: TEST SUCCEEDED, 15 tests, 0 failures.swiftlintwith the repo config: compared before and after, no new violations (only line-number shifts of pre-existing ones inGeolocation.swift).tsc --noEmit,prettier --checkandeslintclean (the 3 eslint warnings inweb.tsare pre-existing).