adaptyteam / AdaptySDK-Flutter

SDK for growing mobile in-app purchases
https://docs.adapty.io/docs/quickstart
MIT License
95 stars 17 forks source link

Adapty calls to AWS every 30 seconds lead to error 400: The security token included in the request is invalid. #51

Closed lcuis closed 2 years ago

lcuis commented 2 years ago

We are using Adapty Flutter plugin as follows:

  adapty_flutter:  '1.0.10'

When running in debug mode on Android with Adapty.setLogLevel(adaptyDebug(appData.objects["adaptyDebug"]));, we see in the console approximately every 30 seconds calls made by Adapty to AWS ending up in error:

D/Adapty_v1.9.0(11531): POST https://kinesis.us-east-1.amazonaws.com/ Body: {"Records":[{"Data":"XXX","PartitionKey":"XXX"},{"Data":"XXX","PartitionKey":"XXX"},{"Data":"XXX","PartitionKey":"XXX"},{"Data":"XXX","PartitionKey":"XXX"},{"Data":"XXX","PartitionKey":"XXX"},{"Data":"XXX","PartitionKey":"XXX"},{"Data":"XXX","PartitionKey":"XXX"},{"Data":"XXX","PartitionKey":"XXX"},{"Data":"XXX
I/System.out(11531): (HTTPLog)-Static: isSBSettingEnabled false
I/System.out(11531): (HTTPLog)-Static: isSBSettingEnabled false
E/Adapty_v1.9.0(11531): Request is unsuccessful. https://kinesis.us-east-1.amazonaws.com/ Code: 400, Response: {"__type":"UnrecognizedClientException","message":"The security token included in the request is invalid."}

Some strings above have been replaced by XXX.

While this doesn't seem to affect the app behavior, we were wondering:

  1. Whether there was a way to avoid those calls?
  2. Whether those calls are necessary?
  3. Whether there is a way to get a "valid security token" for those calls?

We placed some breakpoints on the various calls from the app to Adapty features and nothing seems to cause those calls except the normal use of Adapty.

We were able to answer our first question with this line:

        Adapty.setExternalAnalyticsEnabled(false);