user2526811
user2526811

Reputation: 1253

Facebook App Link issue

This is implemented in AppDelegate

    #import <FBSDKCoreKit/FBSDKCoreKit.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  return [[FBSDKApplicationDelegate sharedInstance] application:application
    didFinishLaunchingWithOptions:launchOptions];
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  return [[FBSDKApplicationDelegate sharedInstance] application:application
    openURL:url
    sourceApplication:sourceApplication
    annotation:annotation
  ];
}

I have App Link with some parameters that is shared on Facebook. If my app is minimized, clicking link on Facebook opens my app and calling function

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
      return [[FBSDKApplicationDelegate sharedInstance] application:application
        openURL:url
        sourceApplication:sourceApplication
        annotation:annotation
      ];
    }

like it should happened.

Problem is if my app is terminated (not minimized) clicking link on Facebook opens my app but function is not called so I can't process input params.

I have found something about handling cold start in Facebook documentation but that info is outdated.

Did I miss something to implement or it is Facebook bug?

Upvotes: 1

Views: 149

Answers (1)

deadbeef
deadbeef

Reputation: 5563

If you have implemented either application:willFinishLaunchingWithOptions: or application:didFinishLaunchingWithOptions:, check that they return YES, otherwise it prevents application:openURL:sourceApplication:annotation: from being called.

Upvotes: 1

Related Questions