Skip to content

SceneDelegate

From April 2027, App Store Connect uploads must use iOS SDK 27 or later. UIKit apps built with SDK 27 must adopt the UIScene lifecycle to launch on iOS 27. See Apple's submission requirements and scene migration guide.

Use SohaSDK 1.3.2.6 or later. If your app already uses SceneDelegate, keep its setup and add the URL forwarding below.

1. Configure Info.plist

Add this configuration for a single-scene Objective-C app:

<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. Add SceneDelegate

For Cocos or Unity projects, configure scene support in the exported iOS project using the approach supported by your engine version.

  • If the project already has a scene delegate, update that class. Otherwise, add one to the app target and use its class name in UISceneDelegateClassName.
  • Keep the engine's game view and startup flow. Connect its window to the UIWindowScene instead of creating a separate game view.
  • Import <SohaSDK/SohaSDK.h> in the scene delegate and add the following method:
- (void)scene:(UIScene *)scene
    openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
    [SohaKit openURLContexts:URLContexts];
}

3. Update AppDelegate

  • Keep SDK initialization in application:didFinishLaunchingWithOptions: and call it exactly once. Return YES from this method.
  • Keep SohaDelegate callbacks in AppDelegate. SceneDelegate handles window setup and scene:openURLContexts:.

Appdemo example

Appdemo's logout and purchase callbacks use AppDelegate.window. Its SceneDelegate assigns the scene's window to this property when connecting, and clears it when disconnecting. This is specific to Appdemo; Cocos/Unity projects should use their existing window handling.

4. Verify

Build with iOS SDK 27 and test on iOS 27 and your oldest supported iOS version: launch, Facebook/Google login callbacks, background/foreground transitions, logout, and purchases.