Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove void promises from appsflyer plugin #1025

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lennartschoch
Copy link

Hi there!

Opening a PR here to solve an issue we've been having when trying to integrate with the Segment Appsflyer plugin.
We're running an Expo app using React Native 0.74.5 with Hermes.

When adding the plugin to our Segment instance (and going through the rest of the integration steps as described in the documentation), we'd see the attribution data on Appsflyer, together with all of our Segment tracking events, indicating the integration went well. What was missing, though, were the Install Attributed and Organic Install events on Segment. Interestingly, this was only the case on production builds, development clients were working just fine.

After diving into this issue, I figured out that the onInstallConversionData callback is called as expected with the right data, but the analytics.track calls for emitting those missing events never end up getting called.

I ended up patching the library on our side, adding .then handler to the track() calls, which suddenly made the Install events appear on Segment.

My hypothesis is that Hermes does some sort of performance optimization on production builds that keeps it from calling the promises all together, thinking they are not in use because of the lack of a promise handler (like then or catch). I used the then handler for an info log, but technically the content of it shouldn't matter here.

I'd love to get this merged so that we can remove the patch from our repo! Let me know what you think :)

@seg-atlantis-prod
Copy link

Atlantis commands can't be run on fork pull requests. To enable, set --allow-fork-prs or, to disable this message, set --silence-fork-pr-errors

@seg-atlantis-prod
Copy link

Error parsing command: EOF found when expecting closing quote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant