403 error - Invalid Application-ID or API key

Using same request headers, App-ID and API key, but different user agent (working on iOS but returns 403 error on Android). Was working fine for awhile until now. Using Algolia for Dart (1.1.1).

Any chance you you rotated the key in the Algolia dashboard? Can you validate that key value is still listed?

Are you using the default read-only search key or do you have a custom key?

I am using the default read-only search key for both clients. It is also still present in the dashboard.

Which client are you using – the community client or the Algolia Flutter Helper? Are you willing to share your code?

Just to confirm – the same dart code is working fine for iOS but failing to connect for Android?

I am using the community client. The application ID and API key is passed in through an environment variable (will change this eventually for better security). Maybe Google Play distribution is affecting these somehow?

class EnvironmentConfig {
  static const ALGOLIA_API_KEY = String.fromEnvironment('ALGOLIA_API_KEY');

This is how I initialize Algolia:

final algoliaProvider = Provider.autoDispose<Algolia>(
  (ref) => const Algolia.init(
    applicationId: EnvironmentConfig.ALGOLIA_APPLICATION_ID,
    apiKey: EnvironmentConfig.ALGOLIA_API_KEY,

I can share the rest of the implementation privately if you need it.

It seems that this is only affecting Android. The clients that we have on iOS don’t seem to be affected as of now.