AppsFlyerSDK / appsflyer-flutter-plugin

Flutter Plugin for AppsFlyer SDK
MIT License
142 stars 111 forks source link

Authentication failed #186

Closed razgovorov87 closed 2 years ago

razgovorov87 commented 2 years ago

For some reason, on some Android devices, when calling the generateInviteLink method, error 401 is returned

dependencies:
     appsflyer_sdk: ^6.4.4+2
final AppsFlyerInviteLinkParams inviteLinkParams = AppsFlyerInviteLinkParams(
      referrerName: '${user.name}',
      customerID: user.customId.toString(),
    );

    appsflyerSdk.generateInviteLink(inviteLinkParams, (result) {
        ....
    }, (error) {
      print('Generate link error: $error');
    });

Error:

Connection error: Response code = 401 content = {"string_response":"Authentication Failed"}

The link that is generated:

https://sfera.land/man?link=https://sfera-app.onelink.me/U9EP?pid=af_app_invites&af_referrer_customer_id=3819OXEL7596&af_referrer_name=%D1%8F&af_referrer_uid=1639553892380-7021489626294103587&af_siteid=com.sfera.app
Снимок экрана 2021-12-15 в 14 42 12

Normal Link:

https://sfera.land/man?link=https://sfera-app.onelink.me/U9EP/76396617

When clicking on this link

DeepLinkResult:{"status":"FOUND","error":null,"deepLink":{"is_deferred":false}}

Android config: Samsung A8(2018) IMAGE 2021-12-15 16:01:35

razgovorov87 commented 2 years ago

To fix this: Add to AndroidManifest.xml:

android:allowBackup="false"

<application
        android:label="*Application Name*"
        android:icon="..."
        --> add here 
        >