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

manualStart option still requires onDeepLink to be set before initSdk #574

Open
MoritzCooks opened this issue Sep 3, 2024 · 1 comment

Comments

@MoritzCooks
Copy link

MoritzCooks commented Sep 3, 2024

Report

Plugin Version

6.12.2

On what Platform are you having the issue?

iOS (probably also Android)

What did you do?

Tried to subsequently register a deeplink handler between initSdk and startSdk with manualStart option set to true

What did you expect to happen?

I would have expected the appyFlyer SDK to allow me adding the deeplink listener subsquently so that the deeplinkHandler gets fired only after the SDK got started through appsFlyer.startSdk()

What happened instead?

Once the app is fully closed and we try to open a deeplink, we see the Sending onDeepLinking with no listeners registered warning appearing.

Please provide any other relevant information.

We are using react-navigation with linking for deeplinking. To be able to get access to the navigation/linking, the appsFlyer init has to be placed within the <NavigationContainer>.
The complexity exists because we want to send an AppStart event once the app has been launched and the App.tsx got executed. To be able to do that, the appsFlyer.initSdk() has to be executed before the first appsFlyer.logEvent() gets fired.

I would expect the onDeepLink to work the same way so that it's possible to run initSdk, set an onDeepLink listener and then finally startSDK once everything is ready.

Example pseudo-code:

// App.tsx
// ...
appsFlyer.initSdk()

appsFlyer.logEvent("AppStart")

return (
  <RandomProvider>
    <RootNavigator />
  </RandomProvider>
)
// RootNavigator.tsx
// ...
const navigationRef = useNavigationContainerRef()

return (
  <NavigationContainer
    ref={navigationRef}
    onReady={() => {
      appsFlyer.onDeepLink = ({ data }) => {
        // using navigation to navigate around 
        navigationRef.current.navigate(data["deep_link_value"])
      }
      appsFlyer.startSdk()
    }}
    linking={linkingConfig}
  >
    {/* screens to navigate to go here */}
  </NavigationContainer>
)
@idrisssakhi
Copy link

having the same issue, when will you resolve this issue ?

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

No branches or pull requests

3 participants