Symptom-driven debugging for the MotiSig Android SDK.
Symptoms grouped by area. Set logLevel = LogLevel.DEBUG in MotiSig.initialize and watch logcat — the SDK tags every line with the MotiSig tag and logs every queued mutation and HTTP failure.
Expected. The SDK treats 409 as success and persists the id locally.
triggerEvent callback never fires
Callback runs on the main thread via Handler(Looper.getMainLooper()). If your app is paused or the main looper is blocked, it can appear stalled.
Ensure the main thread is responsive. Use result.onSuccess / result.onFailure to inspect.
MotiSigError.UserNotSet from triggerEvent
setUser has not been called yet (or logout ran).
Call setUser before any user-scoped mutation. See User and profile.
Mutations sent in unexpected order
Two threads enqueued mutations concurrently without synchronization.
The SDK already serializes via FIFOMutationQueue; observable order is enqueue order. If you need stricter order, await your own coroutines/futures before enqueueing the next call.
MotiSigFirebaseMessagingService not registered, or firebase-messaging dependency missing in the host app.
Register the service in AndroidManifest.xml (or subclass it in your own FirebaseMessagingService). Add implementation("com.google.firebase:firebase-messaging:24.x.x") to the app module.
Notifications.getExpoPushTokenAsync errors
Wrong SDK — that's the Expo SDK.
This Android SDK uses FCM directly.
Push subscription not removed on logout
logout() was called before any FCM token arrived.
Without a token, there's nothing to remove server-side; the local clear still happens.
permission field in subscription is wrong
The user changed notification permission while the app was killed.
The SDK patches permission on the next foreground resume. If you want immediate sync, call MotiSig.getInstance().setNotificationEnabled(true) (or false) which also patches permission.