Add Info.plist URL scheme mapping.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>appfigurate.Example</string>
<key>CFBundleURLSchemes</key>
<array>
<string>example</string>
</array>
</dict>
</array>
Objective-C 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;
}
Swift UIApplicationDelegate example
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
if APLApplicationOpenURL(url) {
return true
}
return false
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
APLApplicationDidFinishLaunchingWithOptions(launchOptions)
return true
}
Objective-C 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);
}
}
Swift UIWindowSceneDelegate example
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
if let url = URLContexts.first?.url {
APLApplicationOpenURL(url)
}
}