refactor(ios)!: remove deprecated Swift and Obj-C APIs for Capacitor 9 - #8551
Merged
Conversation
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.
This was referenced Aug 5, 2026
Draft
andredestro
requested
a lite review from Copilot
and removed request for
Copilot
August 6, 2026 09:06
andredestro
requested review from
ItsChaceD,
OS-pedrogustavobilro,
OS-ruimoreiramendes,
alexgerardojacinto,
jcesarmobile,
markemer and
theproducer
August 6, 2026 09:06
theproducer
approved these changes
Aug 6, 2026
markemer
approved these changes
Aug 6, 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.
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.CAPBridgecompatibility class removed (entire class):CAPBridge.statusBarTappedNotificationNotification.Name.capacitorStatusBarTappedCAPBridge.getLastUrl()ApplicationDelegateProxy.shared.lastURLCAPBridge.handleOpenUrl(_:_:)ApplicationDelegateProxy.shared.application(_:open:options:)CAPBridge.handleContinueActivity(_:_:)ApplicationDelegateProxy.shared.application(_:continue:restorationHandler:)CAPBridge.handleAppBecameActive(_:)CAPBridgeProtocolmethods removed (and theirCapacitorBridgeimplementations):getWebView(),isSimulator(),isDevMode(),getStatusBarVisible(),getStatusBarStyle(),getUserInterfaceStyle(),getLocalUrl(),getSavedCall(_:),releaseCall(callbackId:),presentVC(_:animated:completion:),dismissVC(animated:completion:),modulePrint(_:_:)and thesetStatusBarVisible/Style/Animation(_:)extension helpers. Replaced by the equivalent property accessors,savedCall(withID:)/releaseCall(withID:),viewController?.present/dismissandCAPLog.Other removals:
CAPNotificationsenumNotification.Name.capacitor*constantsPluginCallErrorData,PluginResultData,JSResultBodytypealiasesPluginCallResultDataCAPPluginCall.hasOption(_:)JSDateInstanceConfiguration.getPluginConfigValue(_:_:)getPluginConfig(_:)InstanceConfiguration.getValue(_:)/getString(_:)CAPPlugin.getConfigValue(_:)(Obj-C)getConfig()and thePluginConfigtyped accessorsCAPFileManager.getPortablePath(host:uri:)(entire class)portablePath(fromLocalURL:)on the bridgeCapacitorBridgeconvenience init takingcordovaConfigurationCapacitorBridge.httpsInterceptorStartIdentifierhttpInterceptorStartIdentifierCapacitorUrlRequest.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 removedgetPluginConfigValue.Internal usages were migrated accordingly (
CapacitorBridgenow uses thewebViewproperty directly) and tests were updated to the new APIs (ConfigurationTests,CapacitorTests).Change Type
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
CapacitorTestsandCodableTestssuites pass on the iPhone 17 simulator (xcodebuild test,** TEST SUCCEEDED **).ConfigurationTestswere migrated fromgetPluginConfigValue/getValuetogetPluginConfig(_:)and the direct property accessors, keeping coverage of both top-level and platform-specific legacy config keys.Platforms Affected
Notes / Comments
setRequestHeaders([String: Any])usesURLRequest.setValuewhile the removed[String: String]overload usedaddValue, so repeated header keys now overwrite instead of append.