Fynchat

Mobile SDKs (iOS + Android)

Swift and Kotlin libraries for using Fynchat inside your mobile apps.

The API documentation

What do you get?

Two ready-to-use drag-and-drop files:

Both support:

  • Sending messages (text + template)
  • Managing contacts (CRUD)
  • Querying conversations, templates, and campaigns
  • Verifying Webhook signatures (HMAC SHA-256)

iOS (Swift)

Installation

  1. Download Fynchat.swift
  2. Drag it into your Xcode project
  3. The SDK uses only CryptoKit and URLSession — no extra dependencies

Usage

let fl = Fynchat(apiKey: "fynk_live_xxx")

// free-form text
try await fl.messages.sendText(to: "+966501234567", text: "Hello")

// approved template
try await fl.messages.sendTemplate(
    to: "+966501234567",
    name: "welcome_offer",
    language: "ar",
    variables: ["Ahmed", "RAMADAN20"]
)

// create a contact
let contact = try await fl.contacts.create(
    phone: "+966501234567",
    name: "Ahmed Mohammed",
    tags: ["VIP"]
)

Webhook verification (in an app extension or push receiver)

let valid = Fynchat.verifyWebhook(
    body: rawBody,
    signature: signatureHeader,
    secret: "whsec_xxx"
)

Android (Kotlin)

Installation

  1. Download Fynchat.kt
  2. Place it in your project under com.fyntralink.sdk
  3. Add the dependencies in app/build.gradle:
dependencies {
    implementation("com.squareup.okhttp3:okhttp:4.12.0")
    implementation("org.json:json:20231013")
}

Usage

import com.fyntralink.sdk.Fynchat

val fl = Fynchat("fynk_live_xxx")

// The HTTP calls are synchronous — use them inside a Coroutine or Thread
GlobalScope.launch(Dispatchers.IO) {
    fl.messages.sendText("+966501234567", "Hello")
    fl.messages.sendTemplate(
        to = "+966501234567",
        name = "welcome_offer",
        language = "ar",
        variables = listOf("Ahmed", "RAMADAN20")
    )
    val contact = fl.contacts.create("+966501234567", name = "Ahmed")
}

Webhook verification

val valid = Fynchat.verifyWebhook(
    body = rawBody,
    signature = signatureHeader,
    secret = "whsec_xxx"
)

Security inside the app

Don't put the API key directly in the mobile app! Users can extract it.

Alternatives:

  1. Backend Proxy: the app sends to your backend, and the backend calls Fynchat
  2. Per-User Tokens: build a system of tokens specific to your app's users (requires development)
  3. Restricted-scope keys: create a key with only the messages.send permission plus an IP whitelist

Help

Pro versions of the SDKs (with ready-made UI components) are available to Enterprise customers. Contact [email protected].

Quick links