Method 'Application:Openurl:Options:' Is Not Called

Method 'application:openURL:options:' is not called

Implement scene(_:openURLContexts:) in your scene delegate.

If the URL launches your app, you will get scene(_:willConnectTo:options:) instead and it’s in the options.

Launch App using URL, but OpenUrl Not Called

I agree with Kaloyan, "handleOpenURL" is never called at application launch. So you have to check for URL in "launchOptions" in didFinishLaunchingWithOptions.

HOWEVER

I adopted the same solution as Apple example code for QuickActions (3D Touch). I keep the URL at launch in a variable, and I handle it in applicationDidBecomeActive:.

@interface MyAppDelegate ()
@property (nonatomic, strong) NSURL *launchedURL;
@end

@implementation MyAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.launchedURL = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
...
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
if (self.launchedURL) {
[self openLink:self.launchedURL];
self.launchedURL = nil;
}
}

- (BOOL) application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation
{
NSURL *openUrl = url;

if (!openUrl)
{
return NO;
}
return [self openLink:openUrl];
}

- (BOOL)openLink:(NSURL *)urlLink
{
...
}

@end

application:openURL:options: not called after opening universal link

Clay from Branch here.

The application:openURL:sourceApplications:annotation function (now deprecate to application(_:open:options:)) is actually only called in response to the old Apple Linking system of standard URI schemes.

Universal links are actually handled within the application(_:continue:restorationHandler:) function.

// Respond to URI scheme links
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
// pass the url to the handle deep link call
Branch.getInstance().application(app, open: url, options: options)

// do other deep link routing for the Facebook SDK, Pinterest SDK, etc
return true
}

// Respond to Universal Links
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
// pass the url to the handle deep link call
Branch.getInstance().continue(userActivity)

return true
}

Your deep link handling should mostly be dealt with in your handler callback:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let branch: Branch = Branch.getInstance()
branch?.initSession(launchOptions: launchOptions, deepLinkHandler: { params, error in
if error == nil {
// params are the deep linked params associated with the link that the user clicked -> was re-directed to this app
print("params: %@", params.description)
}
})
return true
}

application:openUrl:options not called when opening app from share sheet of another app

If your app is using scenes, then instead of application(_:open:options:) from UIApplicationDelegate protocol, iOS will call scene(_:openURLContexts:) from UISceneDelegate.

https://developer.apple.com/documentation/uikit/uiscenedelegate/3238059-scene

Also probably it's better to change com.pkware.Zip-archive to com.pkware.zip-archive as it's defined as lowercase in the list of System-Declared UTIs

Implementation of application:openURL:sourceApplication:annotation: not found in iOS 8

It seems that Google sign and Facebook are also inserting an app delegate proxy, as per here - https://firebase.google.com/docs/reference/ios/firebaseanalytics/category_f_i_r_analytics_07_app_delegate_08. This seems to conflict with the CleverTap delegate proxy.

So for now please use the manual integration. We'll look into resolving this issue.

Deep link URL Scheme doesn't call any function in iOS App Delegate

In iOS 13, UIApplication application(_:open:options:) doesn't get called (at least in my case maybe).

You should override the SceneDelegate functions below instead:

func scene(_ scene: UIScene, openURLContexts URLContexts: Set) {
if let url = URLContexts.first?.url{
print(url)
}
}

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// detect the URLContext in the `options:` and deal with it.
}

If the user taps the link when your app isn't running, scene(_: openURLContexts:) won't be called but scene(_:willConnectTo:options:) will be.



Related Topics



Leave a reply



Submit