Skip to content

docs(WL-573): update document about using library, theme, and dynamic strings - #32

Merged
nayaradias merged 3 commits into
mainfrom
docs/WL-573
Oct 5, 2026
Merged

nayaradias merged 3 commits into
mainfrom
docs/WL-573

Conversation

@DanielAraldi

Copy link
Copy Markdown
Contributor

📝 Summary

This PR reviews and updates the library documentation (README.md, docs/THEME.md, and docs/DYNAMIC_STRINGS.md) so other developers can learn how to use @azify/aziface-mobile from the examples alone.

Several examples didn't compile, called the API incorrectly, or hid important runtime behavior. For example, a failed or cancelled session resolves with isSuccess: false instead of throwing, but the examples only used try/catch. Every example now matches the current public API in src/index.tsx and the behavior of the native modules (Android/iOS).

Only documentation is changed. There are no changes to library code.


✅ Checklist

⚠️ Impact

  • Low (isolated change)
  • Medium (affects multiple areas)
  • High (critical flow / risk of regression)

📱 React Native

  • README – Usage: rewrote the section around the three steps of an integration: customize (setTheme, setLocale, setDynamicStrings) → initialize → start a flow.
  • README – Quick start: added a short example of initialize + enroll that checks isSuccess and error.code (Errors).
  • README – Handling results: added a table explaining when initialize rejects and when it resolves false. It also shows what flows resolve on success and on failure or cancellation.
  • README – Concurrent sessions: documented that only one session can run at a time. A call made while another session is running is ignored, and its promise never settles.
  • README – Request headers: documented the headers sent on each session request (custom Headers, Content-Type, X-Device-Key, and X-Testing-API-Header when isDevelopment is true).
  • README – Full example: replaced the old example, which didn't compile (missing StyleSheet import, undefined fontSize, processor = false assigned to a Processor | null type). The new example is typed and smaller. It uses a flow map, disables buttons while a session runs, and switches locales in order instead of at random.
  • README – initialize: the example now shows both the rejected case and the false result.
  • README – Flow methods: in the enroll, authenticate, liveness, photoMatch, and photoScan tables, the data type changed from any to object (matching the real signature). Also documented that data is sent in the request body.
  • README – authenticate: documented that it requires a successful enroll/photoMatch earlier in the same app session (otherwise it returns NotAuthenticated). Running liveness or cancelling a session clears that reference.
  • README – setLocale: fixed the description, which said it returns status/error information. It returns void.
  • README – vocal: explained that it toggles vocal guidance on and off. Fixed the Vocal Guidance example: await was used in a non-async function, headers was missing in initialize, and the FaceView import was missing.
  • README – Params and Headers: added descriptions to the tables.
  • README – FaceView: added a usage example. Renamed the misleading "Returns" column to "Parameter" and fixed the callback count (six, not five).
  • README – Summary links: fixed the broken links (#azifacesdkparams → #params, #azifacesdkheaders → #headers) and added the new Usage subsections.
  • THEME – Image and font examples: the inner function was named initialize, which shadowed the imported function and caused infinite recursion. Renamed it to setup(). These examples also called initialize without headers and said to call setTheme after initialize.
  • THEME – Cancel button position: cancelLocation/cancelPosition belong inside image, not at the root of the theme. The iOS example also used the android key instead of ios.
  • THEME – Font example: replaced guidance.headerFont/guidance.subtextFont, which don't exist in ThemeGuidance, with the global fontFamily.
  • THEME – Android paths: fixed them to android/app/src/main/res/drawable and android/app/src/main/assets/fonts.
  • THEME – Theme table: added the missing initialLoadingAnimation, orientationScreen, and ocrConfirmation rows.
  • THEME – Text fixes: the TOP_LEFT description said "top right", and the intro said initialized instead of initialize. The Usage example now includes imports and full initialize arguments.
  • DYNAMIC_STRINGS – Usage example: rewrote it. The button label was inverted, and the example now shows how to set and reset the strings.
  • DYNAMIC_STRINGS – Navigation: added the missing DynamicStringsRetry entry to the summary and moved DynamicStringsRetryOfficialIdPhoto under it.
  • DYNAMIC_STRINGS – Table name: fixed the types table entry DynamicStringsResultUpload → DynamicStringsResultIdScanUpload.
  • DYNAMIC_STRINGS – Intro: clarified that strings that aren't provided fall back to the SDK default text in the language selected with setLocale.

🤖 Android

--

🍎 iOS

--


🧪 Testing Notes

  • Every full TSX example (export default function App / startEnrollment) in README.md, docs/THEME.md, and docs/DYNAMIC_STRINGS.md was extracted and type-checked with tsc, using the project tsconfig.json and src/index.tsx. No errors.

  • Documented runtime behavior (rejects vs. resolves, concurrent sessions, authenticate prerequisites, request headers) was checked against android/.../AzifaceMobileModule.java, android/.../Config.java, ios/Aziface.swift, and ios/Config.swift.

  • Formatted with Prettier.

  • Tested on Android (device/emulator)

  • Tested on iOS (simulator/device)

  • Automated tests added/updated

  • QA passed


🔗 Related Issues / Tickets

Link any related Jira tickets, GitHub issues, or Trello cards:

  • Closes #WL-573

📸 Evidence (Optional)

Attach any visual evidence of the changes (e.g., screenshots, GIFs, videos, or external links):

  • Screenshot 1: Before/After
  • GIF: Feature in action

⚠️ Notes for Reviewers (Optional)

  • The new runtime notes (promise behavior, concurrent sessions, authenticate prerequisites) describe the current native behavior. They don't change it. If any of these behaviors is unintended (for example, a promise that never settles while a session is running), it should be handled in a separate PR.
  • On iOS, Config.getRequest() force-casts header values (as! String). A null header value may crash, even though the Headers type allows null. That's why the docs don't describe what happens to null headers. This should be checked separately.

@DanielAraldi DanielAraldi self-assigned this Oct 1, 2026
@DanielAraldi DanielAraldi added the documentation Improvements or additions to documentation label Oct 1, 2026
@DanielAraldi DanielAraldi changed the title docs: update document about using library, theme, and dynamic strings docs(WL-573): update document about using library, theme, and dynamic strings Oct 1, 2026
@DanielAraldi
DanielAraldi enabled auto-merge (squash) October 5, 2026 12:56
@nayaradias
nayaradias disabled auto-merge October 5, 2026 14:44
@nayaradias
nayaradias merged commit de634c7 into main Oct 5, 2026
1 check passed
@nayaradias
nayaradias deleted the docs/WL-573 branch October 5, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants