Docs

SDK Configuration Issues

Fix SDK initialization failures, wrong API keys, test/production environment mismatches, and links that come back nil or null.

Issues on this page share one theme: the SDK isn't talking to the Grovs backend the way you think it is. Work through them top to bottom — initialization problems cause everything below them.

SDK not initializing

Cause: Wrong or missing API key, or no network connectivity on the device. On iOS, Grovs.configure reports this directly — its completion is called with success == false.

Fix: Copy the API key from the dashboard under Developer → API Key and pass it exactly as shown in the quick start for your platform (iOS, Android, Flutter, React Native, Web). On iOS, check the completion handler:

Swift
Grovs.configure(APIKey: "your-api-key", useTestEnvironment: false, delegate: self) { success in
    if !success {
        print("Grovs failed to initialize — check the API key and network")
    }
}

A few more things to verify:

  • Where you configure matters. Initialize in application(_:didFinishLaunchingWithOptions:) on iOS and in your Application.onCreate() on Android — not later. On Flutter the key lives in AndroidManifest.xml (grovs_api_key) and Info.plist (GrovsApiKey); a typo in those key names means the SDK silently gets no configuration.
  • The SDK isn't disabled. If you've called setSDK(enabled: false) anywhere (for consent flows, for example), nothing will work until it's re-enabled.
  • Self-hosted backends: pass the baseURL parameter with the domain only — the SDK appends the API path itself.

Test vs production environment mismatch

Cause: Every Grovs project has two environments, and the SDK targets one of them at configure time via useTestEnvironment (true = test, false = production). Each environment has its own domain and URL scheme in the dashboard. If your build says useTestEnvironment = true but you're clicking production links — or your app only registered the production domain/scheme — links won't resolve.

Fix:

  • Set useTestEnvironment deliberately per build: true for development builds, false for release. On iOS/Android/React Native it's a configure parameter; on Flutter it's the grovs_use_test_environment meta-data (Android) and GrovsUseTestEnvironment key (iOS); in the Expo config plugin it's the useTestEnvironment property.
  • Register both environments' values in your app: both applinks: domains (iOS guide), both URL schemes (iOS, Android), and both hosts in your Android intent filters (quick start).
  • Test with links created in the same environment the build targets.

The REST API has the same split: the ENVIRONMENT header takes production or development. See the API Reference.

Cause: generateLink completed but handed you nil/null (iOS, Flutter, React Native) or an error (Android's (link, error) listener). This means the SDK couldn't create the link — typically because initialization failed earlier, the device has no connectivity, or the request was rejected.

Fix:

  1. Confirm the SDK initialized successfully (see SDK not initializing). A failed configure is the most common root cause.
  2. On Android, log the error from the listener — or catch GrovsException if you use the coroutine variant:
Kotlin
Grovs.generateLink(
    title = "Check out this product",
    data = mapOf("productId" to "12345"),
    lifecycleOwner = this,
    listener = { link, error ->
        link?.let { Log.d("Grovs", "Generated: $it") }
        error?.let { Log.e("Grovs", "Error: $it") }
    }
)
  1. Turn on debug logging (below) and retry — the SDK logs the failing request.

Enable debug logging

When anything above is unclear, turn the SDK's logging up and read the device logs (Xcode console on iOS, Logcat on Android):

Swift
// iOS — levels: .info, .warn, .error
Grovs.setDebug(level: .info)
Kotlin
// Android — levels: INFO, ERROR
Grovs.setDebug(LogLevel.INFO)
Dart
// Flutter
await grovs.setDebugLevel('info');

On React Native, call the native Grovs.setDebug in your AppDelegate/MainApplication as shown in the React Native Quick Start.

Set logging to info while integrating, and drop it back before release. The initialization and link-generation log lines usually name the exact problem — bad key, network failure, or rejected request.

Edit this page on GitHubLast updated 2026-07-29