AppsFlyerSDK / appsflyer-flutter-plugin

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

Not getting log events in Appsflyer Dashboard and getting Bad Request in debug logs for Android and IOS both #319

Open Piyush-e7 opened 2 months ago

Piyush-e7 commented 2 months ago

Describe the bug I have implemented appsflyer_sdk: ^6.14.2. I have done all configurations as per the documentation link below. Link: https://github.com/AppsFlyerSDK/appsflyer-flutter-plugin/blob/master/doc/BasicIntegration.md

Code Implementation

AppsflyerSdk? _appsflyerSdk;

// SDK Options
final AppsFlyerOptions options = AppsFlyerOptions(
      afDevKey: AppConfig.appsflyerSdkDevKey,
      appId: AppConfig.appsflyerSdkAppID,
      showDebug: true,
      timeToWaitForATTUserAuthorization: 15,
      manualStart: true,
);
_appsflyerSdk = AppsflyerSdk(options);`

// Initialization of the AppsFlyer SDK
 await _appsflyerSdk?.initSdk(
      registerConversionDataCallback: true,
      registerOnAppOpenAttributionCallback: true,
      registerOnDeepLinkingCallback: true,
 );

// Starting the SDK
 _appsflyerSdk?.startSDK(
      onSuccess: () {
        CommonUtils.printWrapped(
          "Analytics AppsFlyer SDK initialized successfully",
        );
      },
      onError: (int errorCode, String errorMessage) {
        CommonUtils.printWrapped(
          "Error initializing AppsFlyer SDK: Code $errorCode - $errorMessage",
        );
      },
);

Configuration Implementation

For Android: Documentation Link: https://dev.appsflyer.com/hc/docs/install-android-sdk#the-ad_id-permission

<uses-permission android:name="com.google.android.gms.permission.AD_ID"
        tools:node="remove"/>

Android Studio Logs

I/AppsFlyer_6.14.0(18089): [Cache] caching request with URL: https://rjhnws-inapps.appsflyersdk.com/api/v6.14/androidevent?app_id=me.zo&buildnumber=6.14.0 I/AppsFlyer_6.14.0(18089): [Cache] done, cacheKey: 1714457554445 D/AppsFlyer_6.14.0(18089): [HTTP Client] [212666087] POST:https://rjhnws-inapps.appsflyersdk.com/api/v6.14/androidevent?app_id=me.zo&buildnumber=6.14.0 D/AppsFlyer_6.14.0(18089): payload: I/AppsFlyer_6.14.0(18089): [Cache] caching request with URL: https://rjhnws-inapps.appsflyersdk.com/api/v6.14/androidevent?app_id=me.zo&buildnumber=6.14.0 I/AppsFlyer_6.14.0(18089): [Cache] done, cacheKey: 1714457554506 D/AppsFlyer_6.14.0(18089): [HTTP Client] [237080620] POST:https://rjhnws-inapps.appsflyersdk.com/api/v6.14/androidevent?app_id=me.zo&buildnumber=6.14.0 D/AppsFlyer_6.14.0(18089): payload: D/AppsFlyer_6.14.0(18089): [HTTP Client] [212666087] response code:400 Bad Request D/AppsFlyer_6.14.0(18089): body:bad request D/AppsFlyer_6.14.0(18089): took 394ms I/AppsFlyer_6.14.0(18089): [Cache] Deleting 1714457554445 from cache D/AppsFlyer_6.14.0(18089): [HTTP Client] [237080620] response code:400 Bad Request D/AppsFlyer_6.14.0(18089): body:bad request D/AppsFlyer_6.14.0(18089): took 367ms I/AppsFlyer_6.14.0(18089): [Cache] Deleting 1714457554506 from cache D/AppsFlyer_6.14.0(18089): [Queue] execution finished for INAPP-8, result: FAILURE D/AppsFlyer_6.14.0(18089): [Queue] execution finished for INAPP-9, result: FAILURE

Screenshots

Screenshot 2024-04-30 at 12 16 20 PM

Smartphone:

Additional context

If I forgot to implement any configuration so let me know. Please help me to make it runnable.