> ## Documentation Index
> Fetch the complete documentation index at: https://help.airbridge.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting - iOS SDK (Deprecated)

<AccordionGroup>
  <Accordion title="[Xcode 27] SceneDelegate Migration Required — Additional Setup Needed for Airbridge Deep Links">
    <Note>
      This troubleshooting guide is for customers who need to migrate an existing AppDelegate-based app to the `SceneDelegate` (UIScene lifecycle).
    </Note>

    #### Problem

    * When you run an app built with Xcode 27, the screen appears blank (white) or the app does not render properly.
    * Airbridge deep link events are not collected even when the app is opened through a scheme deep link or Universal Link.
    * The app does not work even though the code was added to `AppDelegate` as shown in the developer guide example [Deep Linking > When using AppDelegate](/en/developers/deprecated-ios-sdk-v1#when-using-appdelegate).

    #### Cause

    Apple is moving the app lifecycle from the `UIApplicationDelegate`-only AppDelegate model to the `UIScene`-based SceneDelegate model, and adopting the Scene lifecycle has effectively become required in the latest Xcode and iOS environments.

    When an app adopts the Scene lifecycle through `UIApplicationSceneManifest`, the following `AppDelegate` deep link callbacks are **no longer called.**

    | Existing `AppDelegate` callback | Replacement callback in the Scene lifecycle (`SceneDelegate`) |
    | - | - |
    | `window` creation in `application:didFinishLaunchingWithOptions:` | `scene:willConnectToSession:options:` |
    | Deep link at app cold start | `connectionOptions` of `scene:willConnectToSession:options:` |
    | `application:openURL:options:` | `scene:openURLContexts:` |
    | `application:continueUserActivity:restorationHandler:` | `scene:continueUserActivity:` |

    #### Solution

    ##### 1. Add Scene Manifest to Info.plist

    Add the following `UIApplicationSceneManifest` to `Info.plist`.

    Set the `UISceneDelegateClassName` value to match the language/module you use.

    * Objective-C: `SceneDelegate`
    * Swift: `$(PRODUCT_MODULE_NAME).SceneDelegate`

    ```xml lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
    <key>UIApplicationSceneManifest</key>
    <dict>
        <key>UIApplicationSupportsMultipleScenes</key>
        <false/>
        <key>UISceneConfigurations</key>
        <dict>
            <key>UIWindowSceneSessionRoleApplication</key>
            <array>
                <dict>
                    <key>UISceneConfigurationName</key>
                    <string>Default Configuration</string>
                    <key>UISceneDelegateClassName</key>
                    <string>SceneDelegate</string>
                </dict>
            </array>
        </dict>
    </dict>
    ```

    ##### 2. Create SceneDelegate and move the deep link collection code to SceneDelegate

    <Tabs>
      <Tab title="Swift">
        ```swift lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
        import UIKit
        import AirBridge

        class SceneDelegate: UIResponder, UIWindowSceneDelegate {
            var window: UIWindow?

            func scene(_ scene: UIScene,
                       willConnectTo session: UISceneSession,
                       options connectionOptions: UIScene.ConnectionOptions) {
                guard let windowScene = scene as? UIWindowScene else { return }

                let appDelegate = UIApplication.shared.delegate as? AppDelegate
                let window = UIWindow(windowScene: windowScene)
                window.rootViewController = appDelegate?.window?.rootViewController
                self.window = window
                appDelegate?.window = window
                window.makeKeyAndVisible()

                if let context = connectionOptions.urlContexts.first {
                    AirBridge.deeplink()?.handleURLSchemeDeeplink(context.url)
                }
                if let userActivity = connectionOptions.userActivities.first {
                    AirBridge.deeplink()?.handle(userActivity)
                }
            }

            func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
                if let context = URLContexts.first {
                    AirBridge.deeplink()?.handleURLSchemeDeeplink(context.url)
                }
            }

            func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
                AirBridge.deeplink()?.handle(userActivity)
            }
        }
        ```
      </Tab>

      <Tab title="Objective-C">
        ```objective-c lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
        #import <UIKit/UIKit.h>

        API_AVAILABLE(ios(13.0))
        @interface SceneDelegate : UIResponder <UIWindowSceneDelegate>

        @property (strong, nonatomic) UIWindow *window;

        @end
        ```

        ```objective-c lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
        #import "SceneDelegate.h"
        #import "AppDelegate.h"
        #import <AirBridge/AirBridge.h>

        @implementation SceneDelegate

        - (void)scene:(UIScene *)scene
                willConnectToSession:(UISceneSession *)session
                                          options:(UISceneConnectionOptions *)connectionOptions
        {
            if (![scene isKindOfClass:[UIWindowScene class]]) {
                return;
            }
            UIWindowScene *windowScene = (UIWindowScene *)scene;
            AppDelegate *appDelegate = (AppDelegate *)UIApplication.sharedApplication.delegate;
            UIWindow *window = [[UIWindow alloc] initWithWindowScene:windowScene];
            window.rootViewController = appDelegate.window.rootViewController;
            self.window = window;
            appDelegate.window = window;
            [window makeKeyAndVisible];

            UIOpenURLContext *context = connectionOptions.URLContexts.allObjects.firstObject;
            if (context != nil) {
                [AirBridge.deeplink handleURLSchemeDeeplink:context.URL];
            }
            NSUserActivity *userActivity = connectionOptions.userActivities.allObjects.firstObject;
            if (userActivity != nil) {
                [AirBridge.deeplink handleUserActivity:userActivity];
            }
        }

        - (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts
        {
            UIOpenURLContext *context = URLContexts.allObjects.firstObject;
            if (context != nil) {
                [AirBridge.deeplink handleURLSchemeDeeplink:context.URL];
            }
        }

        - (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity
        {
            [AirBridge.deeplink handleUserActivity:userActivity];
        }

        @end
        ```
      </Tab>
    </Tabs>

    ##### 3. Clean up AppDelegate

    * Keep the SDK initialization code (Objective-C: `[AirBridge getInstance:appName:withLaunchOptions:]`, Swift: `AirBridge.getInstance(_:appName:withLaunchOptions:)`) in `application:didFinishLaunchingWithOptions:` **as is.**
    * `application:openURL:options:` and `application:continueUserActivity:restorationHandler:`, which were added for deep link collection, are not called in the Scene lifecycle. After moving them to `SceneDelegate`, remove them from `AppDelegate`.
  </Accordion>

  <Accordion title="Webcredentials">
    Users may see the domain of passwords stored with the [Password AutoFill](https://developer.apple.com/documentation/security/password-autofill) feature as `airbridge.io` or `abr.ge`. If you want to change the domain to store the password, follow the steps below.

    1. Host the JSON below at `https://example.com/.well-known/apple-app-site-association`. Your prepared domain should be entered instead of `example.com`.

    ```json lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
    {
        "webcredentials": {
            "apps": ["TEAM_ID.APP_BUNDLE_ID"]
        }
    }
    ```

    Example: 9JA89QQLNQ.com.apple.wwdc

    2. Navigate to **\[Xcode]>\[Project File]>\[Signing & Capabilities]>\[Associated Domains]**.
    3. Click **`+`** and add  `webcredentials:example.com.`
  </Accordion>

  <Accordion title="Bitcode compile error">
    Airbridge iOS SDK does not support Bitcode from version 1.28.0. Note that Bitcode has been deprecated from Xcode 14. If you use Bitcode in an App project, you may encounter the following compile errors.

    ```html Text lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
    Textld: XCFrameworkIntermediates/AirBridge/AirBridge.framework/AirBridge(AirBridge-arm64-master.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE)
    ```

    To solve this issue, you need to add the following to the Podfile.

    ```html Podfile lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |configuration|
            configuration.build_settings['ENABLE_BITCODE'] = 'NO'
        end
    end
    ```

    Or you may set the `ENABLE_BITCODE` to `No`.

    <Note>
      Note that Bitcode has been deprecated, and the App Store automatically deletes the Bitcode when .ipa files using Bitcode are submitted.
    </Note>
  </Accordion>

  <Accordion title="Build issues in Xcode 13">
    The Airbridge iOS SDK does not support Xcode 13 and iOS 9 or 10 starting from version 1.28.0.

    If you need to use Xcode 13, use Airbridge iOS SDK versions 1.27.0 or earlier.
  </Accordion>

  <Accordion title="Crashes occurring on iOS versions earlier than 14.2 when installing the SDK using Tuist fetch and SPM">
    The Airbridge iOS SDK utilizes several built-in iOS frameworks. Among them, AdServices requires the iOS version 14.2 or later. However, the Swift Package Manager has a feature that automatically links a framework as `Optional` if its minimum OS version is higher than the Target's minimum OS version. In contrast, when using Tuist fetch—which only retrieves metadata instead of utilizing Swift Package Manager—the framework is linked to `Required`, leading to this issue. You can find the relevant Tuist code [here](https://github.com/tuist/tuist/blob/93a06710b6ce738247436958a762c7ca282a790d/Sources/TuistDependencies/SwiftPackageManager/Utils/PackageInfoMapper.swift#L869).

    In this case, you can resolve the problem by installing the SDK using the method "[Xcode Native Package Manager Support](https://docs.tuist.io/guides/third-party-dependencies)" provided by Tuist, or you can simply download AirBridge.xcframework and add it to the SDK.

    ```swift lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
    .xcframework(path: "${YOUR_PATH}/AirBridge.xcframework")
    .sdk(name: "AdSupport", type: .framework, status: .optional)
    .sdk(name: "iAd", type: .framework, status: .optional)
    .sdk(name: "AdServices", type: .framework, status: .optional)
    .sdk(name: "CoreTelephony", type: .framework, status: .optional)
    .sdk(name: "StoreKit", type: .framework, status: .optional)
    .sdk(name: "AppTrackingTransparency", type: .framework, status: .optional)
    .sdk(name: "WebKit", type: .framework, status: .optional)
    ```
  </Accordion>
</AccordionGroup>
