aws-amplify / amplify-android

The fastest and easiest way to use AWS from your Android app.
https://docs.amplify.aws/lib/q/platform/android/
Apache License 2.0
231 stars 108 forks source link

fix(analytics): Expose a constant for the API name used for Gen2 defineData #2791

Closed mattcreaser closed 1 month ago

mattcreaser commented 1 month ago

Issue #, if available:

Description of changes: Gen2 doesn't have a concept of API names when using defineData, so we hardcode a default name to use instead.

We realized that you need to supply an API name to configure okhttp clients, so customers will need to supply this hardcoded default. Exposing this constant will avoid having customers need to copy/paste a string from documentation.

val plugin = AWSApiPlugin.builder()
  .configureClient(GEN2_DATA_API_NAME) { clientBuilder ->
    // ...
  }
  .build()

Also aligned the value of the constant with Swift to be gen2DataApiName.

How did you test these changes? (Please add a line here how the changes were tested)

Documentation update required?

General Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.