According to the Firebase Dynamic Links documentation, even if the application is not installed, if the user opens a link on the device, the application page in the Appstore opens and after the application is installed, the application processes the link the first time it is launched. After some investigation into how this is handled, I found that Firebase has something called βpending dynamic links,β and it is expected that the AppDelegate method is called using these links:
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
Source of this assumption:
https://groups.google.com/forum/#!msg/firebase-talk/2STD8eIi61I/8KJqZN7TBAAJ
But when I try to test this pending dynamic link function, neither of these two AppDelegate methods was 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 the application is installed, dynamic links work as expected, opening through the openURL method: if it is opened from the gmail application via Chrome, through Universal links on iOS9 and later, if it is opened from Notes or Mail (via Safari on actually).
So my question is: how do pending dynamic links expect to work? What could be the reason my application does not process them?
---------------- EDIT ----------------
The problem was that by default, Firebase tries to open the application with a URL scheme that is equal to the application package identifier, which was not my business. I changed my Firebase configuration to the following:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"];
FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
options.deepLinkURLScheme = @"MY-CUSTOM-SCHEME";
[FIRApp configureWithOptions:options];
And he starts to work, for example. openURL:the method is now called in the very first application if the connection was opened earlier on the device.