2

I'm adding dynamic link to my iOS app. If app was installed, dynamic link works well on iOS 8 and newer. If app was not installed, on iOS 8 simulator, after installation and on first launch,

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url];
    if (dynamicLink) {
        [self handleIncomingDynamicLink:dynamicLink];
        return YES;
    }

    return NO;
}

this method gets called, and everything works well just like the case it's already installed.

But the problem is with iOS 9 and 10 simulators and devices/ and iOS 8 device. According to the guide for iOS 9 and 10,

- (BOOL)application:(UIApplication *)app
            openURL:(NSURL *)url
            options:(NSDictionary<NSString *, id> *)options {

}

This method should be called if the app has not been installed and opened for the first time, but it's not called after installation. And also the openURL method, which was called on iOS 8 simulator, isn't called on iOS 8 device.

[FIRApp configure] is called. And I tested changing CustomURLScheme settings. On iOS 8, it worked without setting [FIROptions defaultOptions].deepLinkURLScheme . But using iOS 8's case, I configured CustomURLScheme, and added that [FIROptions defaultOptions].deepLinkURLScheme setting with that scheme, but also with that line, still only iOS 8 simulator worked.

And even though it doesn't work on the first launch after installation, when I click the link after the installation, it works well.

[update: I tested more changing iOS version and whether on simulator or device]

iOS8.3 device not installed -> don’t work

iOS8.4 simulator not installed -> work

iOS8.3 simulator not installed -> work

iOS9.1 simulator not installed -> work

iOS9.2 simulator not installed -> don’t work

installed -> don’t work

iOS9.3.2 device not installed -> don't work

installed -> work

iPhone 5s iOS 9.3 simulator not installed -> work

installed -> don’t work

iOS10.1 simulator not installed -> work

installed -> work

손지현
  • 61
  • 9
  • I tested more, and on iOS 8 device, openURL isn't called. Only on iOS 8 simulators, openURL is called. (on iOS 10 simulator, openURL isn't called) – 손지현 Nov 22 '16 at 12:29
  • The good news is that [iOS 8 is now at about 3-4% adoption](https://mixpanel.com/trends/#report/ios_10), depending on the source. It's probably not a major consideration. Could you post your full AppDelegate for us to see? – Alex Bauer Nov 22 '16 at 14:45

0 Answers0