iOS apps without Flutter

Add Info.plist URL scheme mapping.

Info.plist example

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>appfigurate.Example</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>example</string>
        </array>
    </dict>
</array>

Call APLApplicationDidFinishLaunchingWithOptions() in your app delegate's application:didFinishLaunchingWithOptions: method.

Call APLApplicationOpenURL() in your app delegate's application:openURL:options: method.

UIApplicationDelegate example

- (BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    if (APLApplicationOpenURL(url) == YES) {
        return YES;
    }
    return NO;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    APLApplicationDidFinishLaunchingWithOptions(launchOptions);
    return YES;
}

If you are using window scenes (iPadOS 13+), call APLApplicationOpenURL() in your scene delegate's scene:openURLContexts: method.

UIWindowSceneDelegate example

- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts API_AVAILABLE(ios(13.0)) {
    NSURL *url = [[[URLContexts allObjects] firstObject] URL];
    if (url != nil) {
        APLApplicationOpenURL(url);
    }
}

Now jump to Info.plist options.

Last updated