From 3946f9160a9cd7b62960d420be78cc8681c299a7 Mon Sep 17 00:00:00 2001 From: Andre Destro Date: Wed, 5 Aug 2026 16:12:16 +0100 Subject: [PATCH] docs: add Capacitor 9 upgrade guide with iOS deprecated API removals --- docs/main/updating/9-0.md | 75 +++++++++++++++++++++++++++++++++++++++ sidebars.js | 1 + 2 files changed, 76 insertions(+) create mode 100644 docs/main/updating/9-0.md diff --git a/docs/main/updating/9-0.md b/docs/main/updating/9-0.md new file mode 100644 index 00000000..c290c3a5 --- /dev/null +++ b/docs/main/updating/9-0.md @@ -0,0 +1,75 @@ +--- +title: Updating to 9.0 +description: Guide for updating Capacitor from v8 to v9 in your app +slug: /updating/9-0 +--- + +# Updating from Capacitor 8 to Capacitor 9 + +In this guide, you'll find steps to update your project to the current Capacitor 9 version as well as a list of breaking changes. + +## iOS + +The following guide describes how to upgrade your Capacitor 8 iOS project to Capacitor 9. + +### Raise iOS Deployment Target + +Capacitor 9 requires iOS 16.0 or greater. + +Do the following for your Xcode project: select the **Project** within the project editor and open the **Build Settings** tab. Under the **Deployment** section, change **iOS Deployment Target** to **iOS 16.0**. Repeat the same steps for any app **Targets**. + +Then, if the project is using CocoaPods, open `ios/App/Podfile` and update the iOS version to 16.0: + +```ruby +platform :ios, '16.0' +``` + +## Breaking changes in @capacitor/ios + +Capacitor 9 removes the Swift and Objective-C APIs that were deprecated in previous major versions. If your app or plugin still uses any of them, replace them as follows. + +### `CAPBridge` compatibility class removed + +The `CAPBridge` class was a compatibility shim and has been removed entirely. Use the replacements below: + +| 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, it was a no-op | + +### Bridge (`CAPBridgeProtocol`) methods removed + +| Removed | Replacement | +| :------ | :---------- | +| `getWebView()` | `webView` property | +| `isSimulator()` | `isSimEnvironment` property | +| `isDevMode()` | `isDevEnvironment` property | +| `getStatusBarVisible()` / `setStatusBarVisible(_:)` | `statusBarVisible` property | +| `getStatusBarStyle()` / `setStatusBarStyle(_:)` | `statusBarStyle` property | +| `setStatusBarAnimation(_:)` | `statusBarAnimation` property | +| `getUserInterfaceStyle()` | `userInterfaceStyle` property | +| `getLocalUrl()` | `config.localURL` | +| `getSavedCall(_:)` | `savedCall(withID:)` | +| `releaseCall(callbackId:)` | `releaseCall(withID:)` | +| `presentVC(_:animated:completion:)` | `viewController?.present(_:animated:completion:)` | +| `dismissVC(animated:completion:)` | `viewController?.dismiss(animated:completion:)` | +| `modulePrint(_:_:)` | `CAPLog.print(_:)` | + +### Other removals + +| Removed | Replacement | +| :------ | :---------- | +| `CAPNotifications` enum | `Notification.Name.capacitor*` constants (e.g. `Notification.Name.capacitorOpenURL`) | +| `PluginCallErrorData`, `PluginResultData` and `JSResultBody` typealiases | `PluginCallResultData` | +| `CAPPluginCall.hasOption(_:)` | Typed accessors (`getString(_:)`, `getInt(_:)`, etc.) | +| `JSDate.toString(_:)` | No longer needed, dates are mapped to strings during serialization | +| `InstanceConfiguration.getPluginConfigValue(_:_:)` | `getPluginConfig(_:)` | +| `InstanceConfiguration.getValue(_:)` / `getString(_:)` | Direct property accessors on `InstanceConfiguration` | +| `CAPPlugin.getConfigValue(_:)` | `getConfig()` and the typed accessors on `PluginConfig` | +| `CAPFileManager.getPortablePath(host:uri:)` | `portablePath(fromLocalURL:)` on the bridge | +| `CapacitorBridge` initializer taking `cordovaConfiguration` | The initializer without the `cordovaConfiguration` parameter | +| `CapacitorBridge.httpsInterceptorStartIdentifier` | `httpInterceptorStartIdentifier`, all proxied requests are handled by it | +| `CapacitorUrlRequest.setRequestHeaders([String: String])` | `setRequestHeaders([String: Any])`. Note: the replacement sets header values instead of appending them, so repeated keys overwrite the previous value | diff --git a/sidebars.js b/sidebars.js index e29ff7ec..5030da0b 100644 --- a/sidebars.js +++ b/sidebars.js @@ -32,6 +32,7 @@ module.exports = { label: 'Upgrade Guides', collapsed: false, items: [ + 'main/updating/9-0', 'main/updating/8-5', 'main/updating/8-0', 'main/updating/plugins/8-0',