AppsFlyerSDK / appsflyer-capacitor-plugin

AppsFlyer SDK plugin for Capacitor
MIT License
15 stars 26 forks source link

`onAppOpenAttribution` takes Firebase Dynamic Links modifications #23

Closed sneko closed 2 years ago

sneko commented 2 years ago

Hi,

When I decide to enable the "Firebase Dynamic Links" plugin it seems Appsflyer will rely on the wrong original URL.

For context:

2022-05-24 16:07:21.980004+0200 Development[1434:138657] [AppsFlyerSDK] [com.appsflyer.serial] [GCD-A02] -[AppsFlyerPlugin onAppOpenAttribution:]:
{
    host = google;
    link = "xxxxxxxxx://google/link/?request_ip_version=IP%5FV4&match_message=No%20pre%2Dinstall%20link%20matched%20for%20this%20device%2E";
    "match_message" = "No pre-install link matched for this device.";
    path = "/link";
    "request_ip_version" = "IP_V4";
    scheme = "com.xxxxxxxxxx.app";
}

Is there an order to set or something else so Appsflyer does not read the Firebase DL modification?

Also I want to precise that when I uninstall Firebase DL, onAppOpenAttribution is not called at all.

Thank you,

cc @pazlavi

pazlavi commented 2 years ago

Hi @sneko, Thank you for reaching out to us.

Although your case is a classic for opening a support ticket, I will explain the situation here if others encounter it. If any further assistance is required after my explanation, please open a support ticket at support@appsflyer.com.

There is nothing wrong with our SDK/plugin behavior here. It is simply a result of letting two or more plugins handle deep links without writing any native logic on your own. Both AppsFlyer's and Firebase's plugins received the openURL notification and simultaneously performed their deep link handling logic. AppsFlyer SDK handles and triggers our callbacks for every deep link passed to our SDK as we support custom links as well as our onelink. You want our SDK not to handle Firebase links. To achieve that, you simply need to that our SDK will not receive this link, which is impossible when we and Firebase plugins depend on Capacitor notifications. If you don't want the AppsFlyer plugin triggered by the Firebase deep link and vice versa, you will have to remove the Capacitor notification and handle the links yourself. This is the only way at this moment you can avoid this situation.

anonimitoraf commented 10 months ago

For anyone who comes across this thread, we've implemented something like this: https://github.com/joinflux/capacitor-firebase-dynamic-links/pull/7/files to allow Firebase Dynamic links to play along with Apps Flyer