AppsFlyerSDK / appsflyer-react-native-plugin

AppsFlyer plugin for React Native
MIT License
278 stars 198 forks source link

Onelink deeplinks not working #565

Open pnogier opened 2 months ago

pnogier commented 2 months ago

Report

Hi there,

We installed the Appsflyer plugin in order to work with deeplinks on our mobile app. The link we created properly redirects us to the store on both platforms, but never redirects to the app when the app is installed.

Plugin Version

6.14.3

On what Platform are you having the issue?

Both iOS and Android

What did you do?

What did you expect to happen?

If the app is not installed: Open the store, then pass the deeplink data to the app If the app is installed: Open the app with the data

What happened instead?

The store always opens

Please provide any other relevant information.

"react-native": "0.71.6",
"react-native-appsflyer": "6.14.3",

Here is the init and usage of the SDK in our App.jsx

    useEffect(() => {
        appsFlyer.onDeepLink((res) => {
            if (res?.deepLinkStatus !== 'NOT_FOUND') {
                handleAppsFlyerDeepLink(res.data);
            }
            Sentry.captureMessage(JSON.stringify(res));
        });

        const options = {
            devKey: OUR_DEV_KEY,
            isDebug: false,
            appId: 'id1516909512',
            onInstallConversionDataListener: false,
            onDeepLinkListener: true,
            timeToWaitForATTUserAuthorization: 10,
        };

        appsFlyer.initSdk(
            options,
            (result) => {
                console.log(result);
            },
            (error) => {
                Sentry.captureException(error);
                console.log(error);
            },
        );
    }, []);

    const handleAppsFlyerDeepLink = (data: any) => {
        const { deep_link_value, deep_link_sub1 } = data;

        // Do what we need to do with the values
    };

Here are the configs of our Info.plist regarding the linking

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLName</key>
    <string>com.getspacial.mobileapp</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>archieapp</string>
    </array>
  </dict>
</array>
<key>AssociatedDomains</key>
<array>
  <string>applinks:archieapp.co</string>
  <string>applinks:archie.onelink.me</string>
</array>

We also set this in our Xcode project entitlements file

<dict>
  <key>aps-environment</key>
  <string>development</string>
  <key>com.apple.developer.associated-domains</key>
  <array>
    <string>applinks:archieapp.co</string>
    <string>applinks:archie.onelink.me</string>
  </array>
  ...
</dict>
github-actions[bot] commented 2 months ago

👋 Hi @pnogier and Thank you for reaching out to us. In order for us to provide optimal support, please submit a ticket to our support team at support@appsflyer.com. When submitting the ticket, please specify:

spylefkaditis commented 2 months ago

I'm having a similar issue. If I click the generated link eg. https://selleralert.onelink.me/hJhj/96pyqr27 it takes me to the store even when I have the app installed.

I checked the /.well-known/apple-app-site-association at the above domain (https://selleralert.onelink.me) and I'm assuming it's supposed to contain the apps information but it doesn't.

{"applinks":{"apps":[],"details":[]}}

amit-kremer93 commented 1 month ago

@spylefkaditis Did you followed the developer instructions in the dev hub? What is the OS version that you test your app on and see this issue?