Quick Start
Install and configure the Grovs React Native SDK in your app
Installation
Install the wrapper package:
Bash
# Using npm
npm install react-native-grovs-wrapper
# Using yarn
yarn add react-native-grovs-wrapperAndroid dependency
Add the Grovs Android SDK to android/app/build.gradle:
Groovy
dependencies {
implementation 'io.grovs:Grovs:1.1.0'
}iOS dependency
The iOS SDK is added automatically via CocoaPods when you run pod install.
Android configuration
1. Initialize the SDK
In your MainApplication class:
Kotlin
override fun onCreate() {
super.onCreate()
Grovs.configure(this, "your-api-key")
}2. Handle incoming links
In your MainActivity class:
Kotlin
override fun onStart() {
super.onStart()
Grovs.onStart(this)
}
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
Grovs.onNewIntent(intent, this)
}3. Add intent filters
Add these to your launcher activity in AndroidManifest.xml:
XML
<!-- Custom URL scheme -->
<intent-filter>
<data android:scheme="your_app_scheme" 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_app_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_app_test_host" />
</intent-filter>iOS configuration
1. Initialize the SDK
In your AppDelegate.swift:
Swift
import Grovs
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Grovs.configure(APIKey: "your-api-key", useTestEnvironment: false, delegate: self)
Grovs.setDebug(level: .info)
return true
}
func grovsReceivedPayloadFromDeeplink(link: String?, payload: [String: Any]?, tracking: [String: Any]?) {
// Native delegate callback
}2. Handle incoming links
Add to your AppDelegate.swift:
Swift
override func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
return Grovs.handleAppDelegate(continue: userActivity, restorationHandler: restorationHandler)
}
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
return Grovs.handleAppDelegate(open: url, options: options)
}3. Configure Associated Domains
- Open the iOS project in Xcode
- Select your app target → Signing & Capabilities
- Add Associated Domains capability
- Add
applinks:your_grovs_hostandapplinks:your_grovs_test_host
4. Configure URL scheme
- In Xcode, select your target → Info tab
- Under URL Types, click +
- Add the URL scheme from your Grovs dashboard (add both production and test schemes)