appsflyer-react-native-plugin: [iOS 14.5] onDeepLink no triggered

Report

onDeepLink handler not being called in iOS 14.5

Plugin Version

“react-native”: “0.64.1” “react-native-appsflyer”: “6.2.41”

On what Platform are you having the issue?

iOS

What did you do?

I updated to Xcode 12.5 and tested opening a deep link on iOS 14.5, and it didn’t trigger onDeepLink. The handler is working fine on iOS 14.4 and 13.5. I tried adding timeToWaitForATTUserAuthorization: 10, but it didn’t help.

export const initAppsFlyer = () => {
  const onDeepLinkCanceller = appsFlyer.onDeepLink(() => {
    try {
      console.log('Deep link handler'); // <---- Never executed
    } catch (e) {
      console.log('');
    }
  });

  appsFlyer.initSdk(
    {
      devKey: APPSFLYER_KEY,
      isDebug: false,
      appId: IOS_APP_ID,
      onDeepLinkListener: true
    },
    () => console.log('Success'), // Success handler
    () => console.log('Failed') // Error handler
  );

  return onDeepLinkCanceller;
};

What did you expect to happen?

Deep link handler to be logged

What happened instead?

Nothing happens

Please provide any other relevant information.

I have Firebase and Facebook SDK installed, so I’m using react-native-permissions to check and request permissions to ATT.


I’d appreciate some help here. I might be missing some configuration. Thanks in advance!

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 30 (6 by maintainers)

Most upvoted comments

@GoldenWings try to go to node_modules/react-native-appsflyer/ios/AppsFlyerAttribution.m and duplicate this line. it should look like this:

else if(self.userActivity && self.restorationHandler){
        [[AppsFlyerLib shared] continueUserActivity:self.userActivity restorationHandler:self.restorationHandler];
        [[AppsFlyerLib shared] continueUserActivity:self.userActivity restorationHandler:self.restorationHandler];
        self.userActivity = nil;
        self.restorationHandler = nil;
    }

if it works for you, a fix should be released in the next release

Our team is facing the same issue with the deferred link on iOS 14.5. The onDeepLink is never triggered in the first launch.

Plugin Version:

"react-native-appsflyer": "6.2.42"

Environment:

  • iOS: 14.5
  • Xcode: 12.5

@michalis-ligopsychakis if you are using universal-links use this if you are using uri-scheme, use this:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *) options {
    [[AppsFlyerAttribution shared] handleOpenUrl:url options:options];
    return YES;
}

@ACHP It worked for us after upgrading to 6.3.50. We did face an issue where deep links were not working when iOS app was opened from a closed state.

We made a change to the file node_modules/react-native-appsflyer/ios/AppsFlyerAttribution.m b/node_modules/react-native-appsflyer/ios/AppsFlyerAttribution.m:

We needed to add this line twice: [[AppsFlyerLib shared] continueUserActivity:self.userActivity restorationHandler:self.restorationHandler]; [[AppsFlyerLib shared] continueUserActivity:self.userActivity restorationHandler:self.restorationHandler];

And it started working.