According to the Firebase Dynamic Links documentation, even if app is not installed, if user opens the link on the device, app page on Appstore opened, and once app installed, application handles the link on the first launch. After some investigation how this handles, I found that Firebase has something called "pending dynamic links", and it is expected, that AppDelegate method is called with these links:
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
The source of this assumption: https://groups.google.com/forum/#!msg/firebase-talk/2STD8eIi61I/8KJqZN7TBAAJ
But when I try to test this "pending dynamic lynks" feature, neither of these two AppDelegate methods been called
-(BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
At the same time, if app installed, dynamic links work as expected, opening through the openURL: method if opened from gmail app through Chrome, through Universal links on iOS9 and later if opened from Notes or Mail app (through Safari actually).
So, my question is: How the "pending dynamic links" are expecting to work? What could be the reason my app doesn't handle them?
----------------EDIT----------------
The problem was, that by default Firebase tries to open the app with URL scheme which equals to the app bundle ID, which was not my case. I have changed my configuration of Firebase to the next:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"];
FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
options.deepLinkURLScheme = @"MY-CUSTOM-SCHEME";
[FIRApp configureWithOptions:options];
And it start working, e.g. openURL:
method is called now on the very first app open if link was opened on the device before.