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

When using brandDomain inside generateInviteLink appsflyer is not shortening the url #371

Open
debasmitasarkar opened this issue Jan 31, 2025 · 1 comment
Labels

Comments

@debasmitasarkar
Copy link

Describe the bug
I am using the generateInviteLink method to shorten deeplink url and I want appsflyer to use brandDomain when creating the invite link.
When I am not providing the brandDomain property, appsflyer correctly shortens the url but the domain is https://xxxx-app-int.onelink.me.
When I do provide the brandDomain,it uses that brandDomain but it does not shorten the url.

To Reproduce
Steps to reproduce the behavior:

Future<String> generateUserInviteLink(
    Map<String?, String?> params, {
    String path = '/',
  }) {
    final completer = Completer<String>();
    var inviteUrl = '';

    final queryParamEntries = params.entries;
    final queryParamsStr =
        queryParamEntries.map((q) => '${q.key}=${q.value}').join('&');
    final map = {'deep_link_value': Uri.encodeFull('$path?$queryParamsStr')};

    _appsflyerSdk.setAppInviteOneLinkID(_oneLinkTemplateId, (dynamic result) {
      if (kDebugMode) {
        debugPrint('OneLink ID was $result');
      }

      _appsflyerSdk.generateInviteLink(
        AppsFlyerInviteLinkParams(
          customParams: {
            'deep_link_value': '/?notificationAnonymousInviteId=1234',
          },
          brandDomain: 'int.abcd.com',
        ),
        (dynamic success) {
          if (kDebugMode) {
            debugPrint('Invite link generated successfully: $success');
          }
          final result = success as Map<dynamic, dynamic>;
          final payload = result['payload'] as Map<String, dynamic>;
          final link = payload['userInviteURL'] as String;
          if (link.isNotEmpty) {
            inviteUrl = link;
            completer.complete(inviteUrl);
            return;
          }
        },
        (dynamic error) {
          if (kDebugMode) {
            debugPrint('Error generating invite link: $error');
          }
          final baseLink = Uri.parse(_baseLinkUrl);
          inviteUrl =
              Uri.https(baseLink.authority, baseLink.path, map).toString();
          completer.complete(inviteUrl);
        },
      );
    });
    return completer.future;
  }

Expected behavior
Appsflyer should use brandDomain provided and should shorten the invite link as well.

Smartphone (please complete the following information):

  • Device: iPhone 15 pro max
  • OS: iOS 17.5
Copy link

👋 Hi @debasmitasarkar 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.

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

No branches or pull requests

2 participants