Docs

Quick Start

Install and configure the Grovs Flutter SDK in your app

Installation

Add the dependency to your pubspec.yaml:

YAML
dependencies:
  grovs_flutter_plugin: ^1.0.1

Then run:

Bash
flutter pub get

Android setup

1. Add configuration to AndroidManifest.xml

Add the Grovs API key and environment setting inside the <application> tag:

XML
<application>
    <meta-data
        android:name="grovs_api_key"
        android:value="YOUR_API_KEY" />
    <meta-data
        android:name="grovs_use_test_environment"
        android:value="true" />
</application>

2. Add intent filters

Add these to your main activity for deep link handling:

XML
<activity android:name=".MainActivity">
    <!-- Custom URL scheme -->
    <intent-filter>
        <data android:scheme="myapp" android:host="open" />
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
    </intent-filter>
 
    <!-- Universal links (production) -->
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" android:host="your_grovs_host" />
    </intent-filter>
 
    <!-- Universal links (test) -->
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" android:host="your_grovs_test_host" />
    </intent-filter>
</activity>

iOS setup

1. Add configuration to Info.plist

XML
<key>GrovsApiKey</key>
<string>YOUR_API_KEY</string>
<key>GrovsUseTestEnvironment</key>
<true/>

2. Configure URL schemes

Add your custom URL scheme to Info.plist:

XML
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>your_grovs_url_scheme</string>
        </array>
    </dict>
</array>

3. Configure Associated Domains

  1. Open your project in Xcode
  2. Select your app target → Signing & Capabilities tab
  3. Click + Capability → add Associated Domains
  4. Add applinks:your_grovs_host and applinks:your_grovs_test_host

Basic usage

Dart
import 'package:grovs_flutter_plugin/grovs.dart';
 
final grovs = Grovs();
 
// Set debug logging
await grovs.setDebugLevel('info');
 
// Set user identity (optional)
await grovs.setUserIdentifier('user-123');
await grovs.setUserAttributes({
  'name': 'Jane Doe',
  'email': '[email protected]',
});

Next steps