We’ve made important updates to our SDKs, removing the previously used trigger method and introducing three new methods: signup, setUserData, and triggerDeeplink. This guide explains how to migrate your existing code to use these new methods.

Do I need to migrate?

If you’re using any SDK version below 1.0.0 (e.g., 0.x.x), you’ll need to migrate to the new methods. The trigger method has been deprecated and will be removed in future releases.

The migration offers several benefits:

  • More precise control over user data management
  • Improved deep linking capabilities
  • Better separation of concerns between signup events and regular user sessions
  • Enhanced tracking accuracy for attribution

If you’re installing our SDK for the first time with version 1.0.0 or above, you can skip this migration guide and directly follow the standard installation instructions for your platform.

Migration Steps:

  1. Replace the trigger method

    • Old Method:
    await linkrunner.trigger({ /* ... */ });
    
    • New Methods:
      • Use signup after your onboarding process:
      await linkrunner.signup(
        userData: LRUserData(
          id: '1',
          name: 'John Doe',
          phone: '9583849238',
          email: 'support@linkrunner.io',
        ),
        data: {}, // Any additional data
      );
      
      • Use setUserData every time the app opens with a logged-in user:
      await linkrunner.setUserData(
        userData: LRUserData(
          id: '1',
          name: 'John Doe',
          phone: '9583849238',
          email: 'support@linkrunner.io',
        ),
      );
      
      • Use triggerDeeplink after navigation is initialized:
      await linkrunner.triggerDeeplink();
      
  2. Recommended Implementation:

    • Call signup once, immediately after user onboarding.
    • Call setUserData whenever the user is logged in and opens the app.
    • Call triggerDeeplink once your app navigation is ready.

These changes ensure more precise control and improved functionality within your Flutter application.

For detailed documentation, refer to our package documentation: linkrunner Flutter SDK