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:
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 yourApplication.onCreate()on Android — not later. On Flutter the key lives inAndroidManifest.xml(grovs_api_key) andInfo.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
baseURLparameter 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
useTestEnvironmentdeliberately per build:truefor development builds,falsefor release. On iOS/Android/React Native it's aconfigureparameter; on Flutter it's thegrovs_use_test_environmentmeta-data (Android) andGrovsUseTestEnvironmentkey (iOS); in the Expo config plugin it's theuseTestEnvironmentproperty. - 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.
Links not generating (nil/null in the callback)
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:
- Confirm the SDK initialized successfully (see SDK not initializing). A failed
configureis the most common root cause. - On Android, log the
errorfrom the listener — or catchGrovsExceptionif you use the coroutine variant:
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") }
}
)- 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):
// iOS — levels: .info, .warn, .error
Grovs.setDebug(level: .info)// Android — levels: INFO, ERROR
Grovs.setDebug(LogLevel.INFO)// 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.