Firebase Dynamic Links not recognized in IOS

Hello,

We are using the Firebase dynamic links plugin to handle links created by a backend server using Firebase REST API.

The plugin works without any issues on Android. But in IOS, when someone clicks the link the app opens but the onDynamicLink() is never called.

We are calling onDynamicLink() in the initializeApp() inside platform ready callback and added GoogleAndroidClientId and GoogleIOSClientId to the platform preferences as mentioned in the documentations. We also have both google-services.json and GoogleService-Info.plist in the project root folder.

We are using a custom domain with the dynamic links and configured it in Firebase console and in XCode we added FirebaseDynamicLinksCustomDomains as mentioned here.

We get couple of errors in XCode console:

[Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure]; ( FirebaseApp.configure() in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8

and (API Keys removed)

2020-03-12 22:15:10.220893+0300 Doorek[32896:4363162] Starting Firebase DynamicLinks plugin 2020-03-12 22:15:10.485683+0300 Doorek[32896:4363376] Task <C948DCF9-2A18-40F9-8A24-FDF61460D9C3>.<2> finished with error [-1003] Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={NSUnderlyingError=0x28255f5d0 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, NSErrorFailingURLStringKey=https://firebasedynamiclinks-ipv6.googleapis.com/v1/installAttribution?key=, NSErrorFailingURLKey=https://firebasedynamiclinks-ipv6.googleapis.com/v1/installAttribution?key=, _kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8, NSLocalizedDescription=A server with the specified hostname could not be found.}

cordova plugin list:

cordova-plugin-androidx 1.0.2 “cordova-plugin-androidx”
cordova-plugin-androidx-adapter 1.1.0 “cordova-plugin-androidx-adapter”
cordova-plugin-device 2.0.3 “Device”
cordova-plugin-firebase-dynamiclinks 4.0.3 “FirebaseDynamicLinksPlugin”
cordova-plugin-ionic-keyboard 2.2.0 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 4.1.3 “cordova-plugin-ionic-webview”
cordova-plugin-splashscreen 5.0.3 “Splashscreen”
cordova-plugin-statusbar 2.4.3 “StatusBar”
cordova-plugin-whitelist 1.3.4 “Whitelist”
cordova-plugin-x-socialsharing 5.6.4 “SocialSharing”
cordova-sqlite-storage 4.0.0 “Cordova sqlite storage plugin - cordova-sqlite-storage plugin version”
cordova-support-android-plugin 1.0.1 “cordova-support-android-plugin”
cordova-support-google-services 1.3.2 “cordova-support-google-services”
es6-promise-plugin 4.2.2 “Promise”

Cordova-ios version 5.1.0

Ionic 5 & Angular 9.

I’ve gone through our configurations in Firebase and our implementation tens of times and I honestly don’t know what is wrong. It just does not work in IOS.

Appreciate any help.

Thanks

1 Like

Any news on this? I got the same problem for not receiving dynamic links on iOS.

I have the same issue with Android. OnDynamicLink is not triggering anytime whenever I click on any link.

Code:

 async initializeApp() {
    this.platform.ready().then(() => {
      cordova.plugins.firebase.dynamiclinks.onDynamicLink().subscribe(
        (res: any) => {
          this.util.show();
          this.util.dynamicLinkData = res;
          this.util.isDynamicLinkProvided = true;
          this.util.show(res);
          this.util.showErrorAlert(res);
          // if (res.deepLink) {
          //   // let splitters: Array<string> = res.deepLink.split("/");
          //   // let productId = splitters[splitters.length - 1];
          //   this.util.dynamicLinkData = res;
          //   this.util.isDynamicLinkProvided = true;
          // }
        },
        (error: any) => {
          this.util.showSimpleAlert(`FDL ERROR: ${error}`);
        }
      );
      this.statusBar.backgroundColorByHexString("#ff9a57");
      this.splashScreen.hide();
      console.log("%cSampurna Bazaar. ", "background: #222; color: #ffb380");
      this.appPages = this.util.appPage;
....

Thanks for help.

Hi, any news on this?

I got a similar problem, but the error is related to the dependency library firebase-analytics:

2022-02-23 00:06:23.837636+0100 AppName[62116:18145645] Starting Firebase Analytics plugin
2022-02-23 00:06:23.838555+0100 AppName[62116:18145956] 8.8.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `FirebaseApp.configure()` to your application initialization. This can be done in in the App Delegate's application(_:didFinishLaunchingWithOptions:)` (or the `@main` struct's initializer in SwiftUI). Read more: https://goo.gl/ctyzm8.
2022-02-23 00:06:23.872266+0100 AppName[62116:18145958] 8.8.0 - [Firebase/Analytics][I-ACS023007] Analytics v.8.8.0 started

In my case I didn’t see any log related to DynamicLinks, it seems it’s not starting at all, because Starting Firebase DynamicLinks plugin` is not triggered.

My actual implementation inside app.component.ts is:

    try {
      const dynamicLink = await this.firebaseDynamicLinks.getDynamicLink();
      this.manageDynamicLinkData(dynamicLink);
    } catch (e) {
      console.warn('[app] Get dynamic links error', e);
    }

    this.firebaseDynamicLinks.onDynamicLink()
      .subscribe((linkData) => {
        // tslint:disable-next-line: no-console
        console.log('[app] Match dynamic links', linkData);
        this.manageDynamicLinkData(linkData);
      }, (error: any) => {
        console.warn('[app] Dynamic links errors trigger', error);
      });

UPDATE
Configuring diagnostic I got:

---- Firebase Dynamic Links diagnostic output start ----
Firebase Dynamic Links framework version 8.8.0
System information: OS iOS, OS version 15.2, model iPhone
Current date 2022-02-23 08:47:57 +0000
Device locale it-IT (raw it_IT), timezone Europe/Rome
ERROR: UIApplication delegate (null) does not implements selector application:openURL:options:. FDL depends on this implementation to retrieve pending dynamic link.
ERROR: Specified custom URL scheme is (null) but Info.plist do not contain such scheme in CFBundleURLTypes key.
	AppID Prefix: SV54DW8788, Team ID: SV54DW8788, AppId Prefix equal to Team ID: YES
performDiagnostic detected 2 ERRORS.
---- Firebase Dynamic Links diagnostic output end ----

Bets regards,
Paolo