appsflyer-flutter-plugin icon indicating copy to clipboard operation
appsflyer-flutter-plugin copied to clipboard

onDeepLinking cannot be monitored

Open tudosxxx opened this issue 1 year ago • 1 comments

`AppsFlyerOptions appsFlyerOptions = AppsFlyerOptions( afDevKey: '*******************', appId: '', showDebug: true, appInviteOneLink: 'mv21', timeToWaitForATTUserAuthorization: 15, manualStart: true ); appsflyerSdk = AppsflyerSdk(appsFlyerOptions);

appsflyerSdk!.onInstallConversionData((res) {
  print("===onInstallConversionData res: $res");
});

// App open attribution callback
appsflyerSdk!.onAppOpenAttribution((res) {
  print("===onAppOpenAttribution res: $res");
});

appsflyerSdk!.onDeepLinking((DeepLinkResult dp) {
  switch (dp.status) {
    case Status.FOUND:
      print(dp.deepLink?.toString());
      print("deep link value: ${dp.deepLink?.deepLinkValue}");
      break;
    case Status.NOT_FOUND:
      print("deep link not found");
      break;
    case Status.ERROR:
      print("deep link error: ${dp.error}");
      break;
    case Status.PARSE_ERROR:
      print("deep link status parsing error");
      break;
  }
});

await appsflyerSdk!.initSdk(
    registerConversionDataCallback: true,
    registerOnAppOpenAttributionCallback: true,
    registerOnDeepLinkingCallback: true);
if (Platform.isAndroid) {
  appsflyerSdk!.performOnDeepLinking();
}

appsflyerSdk!.startSDK(
  onSuccess: () {
    print("===AppsFlyer SDK initialized successfully.");
  },
  onError: (int errorCode, String errorMessage) {
    print("===Error initializing AppsFlyer SDK: Code $errorCode - $errorMessage");
  },
);`

`getOnDeepLinkUrl() async{

AppsFlyerInviteLinkParams inviteLinkParams = AppsFlyerInviteLinkParams(
    channel: "android",
    referrerName: "aaa",
    baseDeepLink: "bbb",
    brandDomain: "ccc",
    customerID: "ddd",
    referreImageUrl: "eee",
    campaign: "fff",
    customParams: {"af_sub1":"hhh"}
);

appsflyerSdk!.generateInviteLink(inviteLinkParams,
        (result){
      print(result);
    },
        (error){
      print(error);
    }
);

}`

When I run the IDE directly, onDeepLinking detects that the deep link is not found, but when I visit the website via the invitation link I created, the website goes to the Google App Store and I open it manually. Each time, the onInstallConversionData method listens for printing. onDeepLinking nothing happens. How to combine this invitation with onDeepLinking and get the custom parameters in the invitation link

tudosxxx avatar May 22 '24 09:05 tudosxxx

👋 Hi @tudosxxx 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 [email protected]. When submitting the ticket, please specify:

  • ✅ your AppsFlyer sign-up (account) email
  • ✅ app ID
  • ✅ production steps
  • ✅ logs
  • ✅ code snippets
  • ✅ and any additional relevant information.

github-actions[bot] avatar May 22 '24 10:05 github-actions[bot]

@tudosxxx Hi did you find any solution ? i am facing the same issue currently

AminSheikh avatar Nov 11 '24 08:11 AminSheikh

@AminSheikh @tudosxxx Here's a sample code that works for me:



class AppsFlyerUtil {
  static AppsflyerSdk appsFlyerSdk = AppsflyerSdk(AppsFlyerOptions(
    manualStart: true,
    afDevKey: "",
    showDebug: kDebugMode,
    timeToWaitForATTUserAuthorization: 15,
  ));

  // Initialize the SDk
  static init() async {
    appsFlyerSdk.initSdk(registerConversionDataCallback: true, registerOnAppOpenAttributionCallback: true, registerOnDeepLinkingCallback: true).then((t) {
      appsFlyerSdk.onDeepLinking((DeepLinkResult dp) {
        try {
          switch (dp.status) {
            case Status.FOUND:
              print(dp.deepLink?.toString());
              if (dp.deepLink?.getStringValue('deep_link_value') != null) {
                print(dp.deepLink!.getStringValue('deep_link_value')!);
                print(dp.deepLink!.getStringValue('deep_link_sub1')!);
              }
              break;
            case Status.NOT_FOUND:
              print("deep link not found");
              break;
            case Status.ERROR:
              print("deep link error: ${dp.error}");
              break;
            case Status.PARSE_ERROR:
              print("deep link status parsing error");
              break;
          }
          print("onDeepLinking res: ${dp.toJson()}");
        } catch (e) {
          print("error in onDeepLinking: $e");
        }
      });

      if (Platform.isAndroid) {
        appsFlyerSdk.performOnDeepLinking();
      }
      appsFlyerSdk.startSDK();
    });
  }

// Call this function to create a shirt link
  static deepLinkSetup() async {
    await appsFlyerSdk.setAppInviteOneLinkID('your-one-link-id', (res) {
      print("setAppInviteOneLinkID callback: $res");
      appsFlyerSdk.generateInviteLink(
          AppsFlyerInviteLinkParams(channel: 'nadroid', baseDeepLink: "", brandDomain: "", referreImageUrl: "", customParams: {
            "deep_link_value": 'value',
            "deep_link_sub1": 'value1',
            // Supports values upto deep_link_sub10 or maybe more
          }), (result) async {
        print(result);
        if (result['status'] == "success") {
          print(result['payload']['userInviteURL']);
        }
      }, (error) {
        print(error);
      });
    });
  }
}



ndungudedan avatar Nov 13 '24 20:11 ndungudedan

You should remove registerOnAppOpenAttributionCallback: true

Abdurahmon727 avatar Feb 18 '25 04:02 Abdurahmon727

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Aug 11 '25 10:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Aug 25 '25 10:08 github-actions[bot]