Skip to content

refactor(ios)!: remove deprecated Swift and Obj-C APIs for Capacitor 9 - #8551

Merged
andredestro merged 6 commits into
nextfrom
chore/RMET-5303-remove-deprecated-ios-apis
Aug 6, 2026
Merged

refactor(ios)!: remove deprecated Swift and Obj-C APIs for Capacitor 9#8551
andredestro merged 6 commits into
nextfrom
chore/RMET-5303-remove-deprecated-ios-apis

Conversation

@andredestro

@andredestro andredestro commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Removes the iOS APIs that were marked @available(*, deprecated) in previous major versions, as part of the Capacitor 9 cleanup. All of them have direct replacements that have been available since Capacitor 3/4.

CAPBridge compatibility class removed (entire class):

Removed Replacement
CAPBridge.statusBarTappedNotification Notification.Name.capacitorStatusBarTapped
CAPBridge.getLastUrl() ApplicationDelegateProxy.shared.lastURL
CAPBridge.handleOpenUrl(_:_:) ApplicationDelegateProxy.shared.application(_:open:options:)
CAPBridge.handleContinueActivity(_:_:) ApplicationDelegateProxy.shared.application(_:continue:restorationHandler:)
CAPBridge.handleAppBecameActive(_:) No longer needed (was a no-op)

CAPBridgeProtocol methods removed (and their CapacitorBridge implementations):

getWebView(), isSimulator(), isDevMode(), getStatusBarVisible(), getStatusBarStyle(), getUserInterfaceStyle(), getLocalUrl(), getSavedCall(_:), releaseCall(callbackId:), presentVC(_:animated:completion:), dismissVC(animated:completion:), modulePrint(_:_:) and the setStatusBarVisible/Style/Animation(_:) extension helpers. Replaced by the equivalent property accessors, savedCall(withID:)/releaseCall(withID:), viewController?.present/dismiss and CAPLog.

Other removals:

Removed Replacement
CAPNotifications enum Notification.Name.capacitor* constants
PluginCallErrorData, PluginResultData, JSResultBody typealiases PluginCallResultData
CAPPluginCall.hasOption(_:) Typed accessors
JSDate No longer needed, dates are mapped to strings during serialization
InstanceConfiguration.getPluginConfigValue(_:_:) getPluginConfig(_:)
InstanceConfiguration.getValue(_:) / getString(_:) Direct property accessors
CAPPlugin.getConfigValue(_:) (Obj-C) getConfig() and the PluginConfig typed accessors
CAPFileManager.getPortablePath(host:uri:) (entire class) portablePath(fromLocalURL:) on the bridge
CapacitorBridge convenience init taking cordovaConfiguration The init without that parameter
CapacitorBridge.httpsInterceptorStartIdentifier httpInterceptorStartIdentifier
CapacitorUrlRequest.setRequestHeaders([String: String]) setRequestHeaders([String: Any])

The Obj-C CAPPlugin.getConfigValue: (deprecated via __deprecated_msg) is also removed because it was the last caller of the removed getPluginConfigValue.

Internal usages were migrated accordingly (CapacitorBridge now uses the webView property directly) and tests were updated to the new APIs (ConfigurationTests, CapacitorTests).

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

Capacitor 9 is a major release, which is the opportunity to drop APIs that have been deprecated for several majors. This reduces the public API surface, removes dead compatibility shims and makes deprecation messages actionable again (RMET-5303).

Tests or Reproductions

  • Full CapacitorTests and CodableTests suites pass on the iPhone 17 simulator (xcodebuild test, ** TEST SUCCEEDED **).
  • ConfigurationTests were migrated from getPluginConfigValue/getValue to getPluginConfig(_:) and the direct property accessors, keeping coverage of both top-level and platform-specific legacy config keys.
  • Built and ran capacitor-testapp against this branch: all official plugins compile against the new API surface, the bridge boots, the splash screen hides and plugin calls round-trip normally.
  • Verified no remaining references to the removed symbols across the repository.

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

Removes the deprecated CAPBridgeProtocol requirements (getWebView,
isSimulator, isDevMode, getStatusBarVisible/Style, getUserInterfaceStyle,
getLocalUrl, getSavedCall, releaseCall(callbackId:), presentVC, dismissVC,
modulePrint, setStatusBar* helpers) and their CapacitorBridge
implementations, the deprecated CapacitorBridge convenience initializer
taking cordovaConfiguration, and the unused httpsInterceptorStartIdentifier
constant. Use the property accessors, savedCall(withID:)/releaseCall(withID:),
viewController?.present/dismiss, and CAPLog instead.
Use the Notification.Name.capacitor* constants instead.
…and JSDate

PluginCallErrorData, PluginResultData and JSResultBody are replaced by
PluginCallResultData. hasOption is replaced by the typed accessors and
JSDate.toString is no longer needed since dates are mapped to strings
during serialization.
Removes InstanceConfiguration.getPluginConfigValue, getValue and getString
along with CAPPlugin.getConfigValue: which depended on them. Use
getPluginConfig(_:) and the direct configuration property accessors instead.
The [String: String] overload is replaced by the [String: Any] version.
Note the replacement uses setValue instead of addValue, so repeated keys
overwrite rather than append.
CAPBridge was a deprecated compatibility shim: statusBarTappedNotification
moved to Notification.Name.capacitorStatusBarTapped, and getLastUrl plus
the application delegate helpers (handleOpenUrl, handleContinueActivity)
moved to ApplicationDelegateProxy.shared. CAPFileManager.getPortablePath
is replaced by portablePath(fromLocalURL:) on the bridge.
@andredestro
andredestro merged commit 191d3b4 into next Aug 6, 2026
8 checks passed
@andredestro
andredestro deleted the chore/RMET-5303-remove-deprecated-ios-apis branch August 6, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants