Mobile SDK & plugins
Install Truzzt in Flutter, Ionic, Capacitor, Cordova, React Native, Java/Kotlin, or Swift. Call configure(apiKey, projectId) first. Android reads SIM chip, device info (*#06#), SIM settings, and Contacts; iOS reads Contacts Me card + saved owner lines (Settings → Phone / Cellular equivalent).
Quick links
Platform matrix
No manual number entry. The SDK collects lines in the background after the user Allows access. Any matching line → success. Server never accepts the session phone without a device-reported line.
| Stack | Path | Devices | Line sources |
|---|---|---|---|
| Java / Kotlin | android/ | Android | SIM chip, device info API, *#06#, SIM settings, Contacts |
| Swift | ios/ | iOS | Contacts Me, Cellular-equivalent lines, saved owner contacts |
| Capacitor / Ionic | packages/capacitor | Android + iOS | Native SDK per OS |
| Cordova / Ionic Cordova | packages/cordova | Android + iOS | Native SDK per OS |
| Flutter | packages/flutter | Android + iOS | Native SDK per OS |
| React Native | packages/react-native | Android + iOS | Native SDK per OS |
How it works
- Your backend calls
POST /secure-api/v1/verificationswith the claimed phone +projectId. - API returns
verifyUrl(and QR). - Your app calls
openVerify({ url })(SDK WebView / Agent). - User Allows permission — SDK reads all available lines in background.
- Verify page POSTs lines → server matches registered phone against any reported line.
- Match →
matched: true+ webhookidentity.verified(includesmatchedSlot,matchedSource). - SDK returns success to your app UI.
Shared methods & result
| Method | Purpose |
|---|---|
configure(apiKey, projectId) | Required before any SDK call; validates trial/plan via /sdk/access |
requestPermissions() | Phone + Contacts (Android); Contacts (iOS) |
getSimPhones() / getDeviceIdentity() | All collected lines (phone + optional IMEI/ICCID) |
checkAuthentication(expectedPhone) | Background check — does any line match? Returns sources used |
captureDeviceInfoDialog() | Android only — trigger *#06# for accessibility capture |
openVerify({ url }) | Permission → read → match → { matched, matchedSlot, sessionId } |
{
"matched": true,
"status": "completed",
"matchedSlot": "sim1",
"matchedSource": "device_info_api",
"sessionId": "sess_…",
"platform": "android" | "ios"
}
Always treat the webhook as the source of truth for your backend.
Line sources (Android & iOS)
Android merges these automatically (each line tagged with source):
sim_chip— SIM1/SIM2 MSISDN from telephony APIsdevice_info_api— MSISDN, IMEI, ICCID per slot (same as *#06#)sim_settings— number from subscription / SIM settingsdialer_star06— *#06# dialog via accessibility service (optional)contacts_saved:…— owner contacts (My number / رقمي)
iOS (Apple does not expose SIM chip MSISDN):
settings_phone_my_number— Settings → Phone → My Number (via Contacts Me)settings_cellular_sim1/sim2— Settings → Cellular → each SIM linecontacts_me— Phone → Contacts → My Cardcontacts_saved:…— saved owner contacts
Authentication & matching
Before verify, call checkAuthentication(expectedPhone) to see if any collected line matches (returns authenticated, matches[], sources[]). During verify, the server compares the session phone to every reported line — exact or suffix match (country-code variants). IMEI/ICCID are audit metadata only.
Trial + active plan = unlimited verifications. Wallet is for buying subscription plans only.
Permissions
Android: READ_PHONE_STATE, READ_PHONE_NUMBERS, READ_CONTACTS, INTERNET. Optional: enable Truzzt Device Info accessibility for *#06# capture.
iOS: Contacts permission + NSContactsUsageDescription. User must have their number on Me card or saved owner contacts.
Plain browsers cannot read device lines — open verifyUrl inside SDK or Agent only.
Android (Java / Kotlin)
Docs: ANDROID.md · Module: android/
git clone https://github.com/kreatedeviq/truzzt-sdk.git
# settings.gradle
include ':truzzt-sdk'
project(':truzzt-sdk').projectDir = new File('path/to/truzzt-sdk/android')
# app/build.gradle
implementation project(':truzzt-sdk')
TruzztSdk.requestPermissions(this) startActivityForResult(TruzztSdk.verifyIntent(this, sessionUrl), 9101) // onActivityResult → TruzztSdk.parseResult(data)
iOS (Swift)
Docs: IOS.md · Package: ios/ (SPM)
.package(url: "https://github.com/kreatedeviq/truzzt-sdk.git", from: "1.0.0")
// product: TruzztSdk
TruzztSdk.openVerify(from: self, sessionUrl: url) { result in
// result.matched — no manual SIM typing
}
Same product rule: SDK bridge only. For dual-SIM chip MSISDN, Android SDK / Agent is the reliable path (Apple limits silent MSISDN).
Capacitor / Ionic Capacitor
Docs: CAPACITOR.md · Android + iOS
npm i https://github.com/kreatedeviq/truzzt-sdk/packages/capacitor
npx cap sync
import Truzzt from '@truzzt/capacitor'
await Truzzt.requestPermissions()
const r = await Truzzt.openVerify({ url: verifyUrl }) // SDK reads SIMs → match
Cordova / Ionic Cordova
Docs: CORDOVA.md · Android + iOS
cordova plugin add https://github.com/kreatedeviq/truzzt-sdk.git#main:packages/cordova
Truzzt.requestPermissions(console.log, console.error)
Truzzt.openVerify({ url: verifyUrl }, console.log, console.error)
Flutter
Docs: FLUTTER.md · Android + iOS
dependencies:
truzzt_flutter:
git:
url: https://github.com/kreatedeviq/truzzt-sdk.git
path: packages/flutter
await TruzztFlutter.requestPermissions();
final r = await TruzztFlutter.openVerify(verifyUrl);
React Native
Docs: REACT_NATIVE.md · Android + iOS
import { openVerify, requestPermissions } from '@truzzt/react-native'
await requestPermissions()
const r = await openVerify(verifyUrl)
Adjustment & making it work
- Set project
webhook_urlin the dashboard. - Create session with the exact phone the user claims (E.164).
- Open
verifyUrlviaopenVerifyin the SDK (not Chrome). - User Allows Phone + Contacts — SDK reads all sources automatically.
- Match → success + webhook. Check
matchedSourceto see which source matched.
Common issues
| Symptom | Fix |
|---|---|
SDK_REQUIRED | Open verify inside SDK / Agent — browsers cannot read SIMs |
| Permission denied | User must Allow Phone; call requestPermissions again |
| Empty line list (Android) | Enable accessibility for *#06#; save number as contact "رقمي"; check carrier exposes MSISDN |
| Empty line list (iOS) | Add number to Contacts → My Card; or save contact named "My number" |
| Mismatch | SDK-read number ≠ registered session phone — expected fail |
| Gradle / plugin missing | Fix path / cap sync / clean rebuild |
Clone
git clone https://github.com/kreatedeviq/truzzt-sdk.git cd truzzt-sdk # Guides: docs/ANDROID.md · IOS.md · CAPACITOR.md · CORDOVA.md · FLUTTER.md · REACT_NATIVE.md