[Xcode 27] SceneDelegate Migration Required — Additional Setup Needed for Airbridge Deep Links
[Xcode 27] SceneDelegate Migration Required — Additional Setup Needed for Airbridge Deep Links
AttentionThis troubleshooting guide is for customers who need to migrate an existing AppDelegate-based app to
SceneDelegate and the UIScene lifecycle.Problem
- An app built with Xcode 27 (iOS 27 SDK) fails to launch and terminates immediately with the runtime issue
UIScene life cycle is required for apps built with this SDK. - After the Scene lifecycle is adopted, an
EXC_BAD_ACCESS (code=1, address=0x0)crash occurs nearGeneratedPluginRegistrant.register(with:)and the app terminates immediately. - 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
AppDelegateas shown in the iOS setup and iOS deep link setup developer guide examples.
Cause
Apple is moving the app lifecycle from theUIApplicationDelegate-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 callbacks are no longer called.Solution
1. Add Scene Manifest to Info.plist
Add the followingUIApplicationSceneManifest to Info.plist.Set UISceneDelegateClassName to match the language/module you use, and be sure to set UISceneStoryboardFile to Main.(Without this value, FlutterViewController is not created as the scene’s rootViewController, so plugin registration fails.)UISceneDelegateClassName- Objective-C:
SceneDelegate - Swift:
$(PRODUCT_MODULE_NAME).SceneDelegate
- Objective-C:
2. Create SceneDelegate and move the deep link collection code to SceneDelegate
- Swift
- Objective-C
3. Clean up AppDelegate
- Leave the SDK initialization code (Swift:
AirbridgeFlutter.initSDK(appName:appToken:withLaunchOptions:), Objective-C:[AirbridgeFlutter initSDKWithAppName:appToken:withLaunchOptions:]) inapplication:didFinishLaunchingWithOptions:as is. - The
application:openURL:options:andapplication:continueUserActivity:restorationHandler:methods you wrote to collect deep links are not called in the Scene lifecycle, so after moving them toSceneDelegate, delete them fromAppDelegate. GeneratedPluginRegistrant.register(with: self)relies onFlutterAppDelegatebuilding the plugin registrar throughself.window.rootViewController(FlutterViewController). In the Scene lifecycle thewindowis owned by theSceneDelegate, soAppDelegate’sself.windowbecomesnil. As a result the registrar is returned asnil, and a plugin that dereferences thisniltriggers anEXC_BAD_ACCESS (address=0x0)crash. Therefore plugin registration (GeneratedPluginRegistrant.register) must be moved to theSceneDelegate, whereFlutterViewControllerexists.
Bitcode Compile Error
Bitcode Compile Error
An error like the one below may occur when creating iOS builds with Flutter SDK v3.0.1 or later as the Bitcod is not supported.Flutter SDK v3.0.1+ is updated to Airbridge iOS SDK v1.28.0+, and Bitcode is no longer supported. Refer to the Bitcode compile error guide for more details.
settings.gradle (Android only)
settings.gradle (Android only)
If you encounter the error message “
Plugin project ... not found. Please update settings.gradle,” edit the android/settings.gradle file as shown below.Could not find or use auto-linked library...
Could not find or use auto-linked library...
Flutter issue: https://github.com/flutter/flutter/issues/16049Airbridge Flutter SDK is a Swift plugin, and an error occurs when the Swift Plugin is used in a 100% Objective C project uses the Swift Plugin.To solve this issue, click
File > New > File... > Swift File to create an empty Swift file and a bridge header.This issue does not occur when using Objective C & Swift Project and 100% Swift Project.Resolve Airbridge SDK backup rules merge conflict issue
Resolve Airbridge SDK backup rules merge conflict issue
- Reference : Android SDK Auto Backup
backup_rules.xml setup
backup_rules.xml setup
- Create a
android/app/src/main/res/xmlfolder. - Within the created xml folder, create a file (e.g.
custom_backup_rules.xml). - Add the data backup rules defined in the Airbridge SDK as follows.
AndroidManifest.xml setup
AndroidManifest.xml setup