AppsFlyerSDK / appsflyer-react-native-plugin

AppsFlyer plugin for React Native
MIT License
284 stars 202 forks source link

Onelink deeplinks not working #565

Open pnogier opened 4 months ago

pnogier commented 4 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 4 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 4 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 4 months 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?

Rhyce commented 1 month ago

I'm also seeing this issue using Expo on react-native-appsflyer 6.15.1 (it also didn't work for me on 6.14.3). Deeplinks are not working at all. My /.well-known/apple-app-site-association does have data and has been setup through OneLink management.

My appsFlyer.onDeepLink((res) => {}); doesn't give me anything either. I've confirmed multiple times that everything is setup as the docs say.

I'm on iOS 18.1 I've also disabled anything I can think of that could prevent it from working, I've made sure I'm not running any VPNs, adblockers and have disabled Private Relay.

eraydemirok commented 2 days ago

Hello, I am experiencing the same issue. Even though the app is installed on my device, the App Store opens. Have you found a solution?