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

No callback when using generateInviteLink on Android #352

Open
mobile-development-group-com opened this issue Oct 23, 2024 · 1 comment
Open

Comments

@mobile-development-group-com
Copy link

mobile-development-group-com commented Oct 23, 2024

Describe the bug
At some point the generateInviteLink stops working on Android. When reinstalling the app the call is working the first few times then in stops.

setAppInviteOneLinkID returns successfull: {"status":"success","data":"success"}

generateInviteLink never returns with a success or an error.

To Reproduce
Steps to reproduce the behavior:
After a while it just stops working (within the same day everytime we tested it)

    // Creating the required parameters of the OneLink
    final name = userData.userName;
    final promoCode = userData.promoCode?.code;
    final userId = userData.uid;
    AppsFlyerInviteLinkParams inviteLinkParams = AppsFlyerInviteLinkParams(
      referrerName: name != null && name.contains("null") == false ? name : "Your friend",
      customerID: userData.device?.appsflyerId,
      customParams: {
        if (promoCode != null) "promoCode": promoCode,
        if (userId != null) "userId": userId,
      },
      brandDomain: "${company}.onelink.me/64B4",
      channel: "mobile_share",
      campaign: "default",
    );

    // Generating the OneLink
    _appsflyerSdk.generateInviteLink(inviteLinkParams, (result) {
      debugPrint("generateInviteLink result: $result");
      if (result is! Map) return;
      final payload = result.containsKey("payload") ? result["payload"] : null;
      if (payload is! Map) return;
      final userInviteURL = payload.containsKey("userInviteURL") ? payload["userInviteURL"] : null;
      final uri = Uri.tryParse(userInviteURL);
      if (uri != null) {
        completer.complete(uri);
      } else {
        completer.completeError("Error generating invite link");
      }
    }, (error) {
      debugPrint("generateInviteLink error: $error");
      completer.completeError(error);
    });

Expected behavior
generateInviteLink always calls a success or error callback.

Smartphone (please complete the following information):

  • Device: Galaxy S24
  • OS: Android version 14
  • Google play system update 1 august 2024
  • One UI version 6.1
@joshuadeguzman
Copy link

Hey, yeah I noticed this too.

What I found working is calling generateInviteLink inside the setAppInviteOneLinkID() callback.

The setAppInviteOneLinkID method is supposed to be async, and awaited properly before generate invite link call, but it isn't.

Let me know how it worked out for you.

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

No branches or pull requests

2 participants