Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions docs/main/updating/9-0.md
Original file line number Diff line number Diff line change
@@ -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 |
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down