Mobile SDK
Errors
Every error the SDK and its delivery API can produce, what causes it and how to fix it.
Where errors show up
| Call | Load failures | Other errors |
|---|---|---|
present | It throws (iOS and Android), or the promise rejects with code miniwall_error (React Native and Flutter). Use try/catch. | onError |
| Embedded screen | onError; the view stays empty | onError |
| Auto placements | onError | onError |
preload | Silent: a placement that fails is skipped | none |
API error codes
The delivery API answers errors as { error: { code, message } }. The SDK throws Miniwall: followed by the message.
| Status | code | Message | Cause and fix |
|---|---|---|---|
| 401 | invalid_key | Missing or invalid public key | The key is missing, mistyped, revoked, or not a pk_ key. Copy it from API keys. |
| 404 | not_found | Placement not found | The key matches no placement. Check spelling and the project. |
| 404 | not_found | Paywall not found | The placement has no screen chosen. |
| 404 | not_found | Published paywall not found | The screen was never published (or was deleted). Publish it. |
| 400 | bad_request | Body must be JSON, or a field message | An events request was malformed. Not caused by normal use. |
| 429 | rate_limited | Too many events, slow down | More than 1200 events a minute on one key. Events are dropped. |
| 500 | internal | Something went wrong on our side. Try again. | Server fault. A saved copy is used if there is one. |
A 5xx answer, a network failure or a timeout uses the saved copy when one exists. A 4xx answer is never replaced by a copy. Apps send no origin, so the web's origin_not_allowed error does not apply.
Messages thrown by the SDK
| Message | Cause and fix |
|---|---|
Miniwall: call Miniwall.configure(apiKey:) before loading a placement (iOS), ... configure(context, apiKey) ... (Android) | Call configure first. |
Miniwall: the screen took too long to load | No answer within the timeout and no saved copy. |
Miniwall: could not load the screen (STATUS) | A non-OK answer with no message. |
Miniwall: not a screen JSON (expected components_config.base.stack) | A JSON source does not hold a screen. |
Miniwall: screen ID is not a screen JSON | A linked screen's JSON is not a screen. |
Miniwall: screens[ID] is not a screen JSON | A JSON you passed in screens is not a screen. |
Miniwall: screen ID could not be loaded | A linked screen failed to load. It is retried on the next tap. Sent to onError. |
Miniwall: pass onPurchase in PresentOptions to handle purchase buttons | A purchase button was tapped with no onPurchase. Sent to onError. |
Miniwall: not opening "...": only http(s), mailto and tel links open | A link with another scheme was refused. Sent to onError. |
Miniwall: present needs a source (placement, paywallId or json) | React Native or Flutter was called without a source. |
Miniwall: present needs an Activity | Android: pass a live Activity to present. |
Miniwall: no StoreKit product for package ID | iOS: storeKitPurchase has no product for the tapped package. |
Miniwall: the App Store could not verify the purchase | iOS: the StoreKit transaction was not verified. |
Related
Events and privacy
What the SDK sends to Miniwall, what it never sends, what it stores on the device, how to answer the App Store and Google Play privacy questions, and how to turn analytics off.
Versioning
How the Mobile SDK packages are versioned, what stays compatible, and how new components and display formats reach older apps.