Skip to content

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

Open
@debasmitasarkar

Description

@debasmitasarkar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions