Mobile SDKs

Gurulu provides native SDKs for iOS, Android, React Native, and Flutter. Mobile SDKs share the same auto-detection engine as the web tracker -- events, errors, and flow graphs are captured automatically.

Pairing flow

All mobile SDKs use a device-pair flow. After installing the SDK, call the pair method with your site ID. The user scans a QR code or enters a 6-digit code on the Gurulu dashboard to link the device.

iOS (Swift)

Installation

Package.swift
.package(url: "https://github.com/gurulu-io/gurulu-swift", from: "1.0.0")

Setup

AppDelegate.swift
import Gurulu

func application(_ application: UIApplication,
  didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  Gurulu.configure(siteId: "YOUR_SITE_ID", token: "YOUR_TOKEN")
  return true
}

Track events

Gurulu.track("purchase", properties: ["amount": 29.99])

Android (Kotlin)

Installation

build.gradle.kts
implementation("io.gurulu:gurulu-android:1.0.0")

Setup

Application.kt
import io.gurulu.Gurulu

class App : Application() {
  override fun onCreate() {
    super.onCreate()
    Gurulu.configure(this, siteId = "YOUR_SITE_ID", token = "YOUR_TOKEN")
  }
}

Track events

Gurulu.track("purchase", mapOf("amount" to 29.99))

React Native

npm install @gurulu/react-native
import { configure, track } from '@gurulu/react-native';

configure({ siteId: 'YOUR_SITE_ID', token: 'YOUR_TOKEN' });

// Later:
track('purchase', { amount: 29.99 });

Flutter

pubspec.yaml
dependencies:
  gurulu_flutter: ^1.0.0
import 'package:gurulu_flutter/gurulu_flutter.dart';

void main() {
  Gurulu.configure(siteId: 'YOUR_SITE_ID', token: 'YOUR_TOKEN');
  runApp(MyApp());
}

// Track:
Gurulu.track('purchase', {'amount': 29.99});