
Some checks failed
CI - 4NK Node / Code Quality (push) Failing after 30s
CI - 4NK Node / Unit Tests (push) Failing after 29s
CI - 4NK Node / Integration Tests (push) Failing after 9s
CI - 4NK Node / Security Tests (push) Failing after 27s
CI - 4NK Node / Docker Build & Test (push) Failing after 9s
CI - 4NK Node / Documentation Tests (push) Failing after 3s
CI - 4NK Node / Release Guard (push) Has been skipped
CI - 4NK Node / Performance Tests (push) Failing after 30s
CI - 4NK Node / Notify (push) Failing after 2s
22 lines
805 B
Markdown
22 lines
805 B
Markdown
# Intégration WebView ↔ ihm_client
|
||
|
||
## Principes
|
||
- `ihm_client` parle via `window.postMessage` (cf. `ihm_client/docs/INTEGRATION_IFRAME.md`)
|
||
- En mobile, on charge `ihm_client` dans une WebView
|
||
- On redirige `window.postMessage` vers `ReactNativeWebView.postMessage`
|
||
- Canal entrant: RN appelle `window.__RN_RECEIVE__(jsonString)` pour simuler un `MessageEvent`
|
||
|
||
## Messages pris en charge (extraits)
|
||
- REQUEST_LINK → LINK_ACCEPTED|ERROR
|
||
- VALIDATE_TOKEN → VALIDATE_TOKEN
|
||
- RENEW_TOKEN → RENEW_TOKEN
|
||
|
||
## Mapping côté RN
|
||
- Sortant: RN → `__RN_RECEIVE__(jsonString)` (déclenche un `message` côté page)
|
||
- Entrant: page → `postMessage(any)` redirigé vers RN `onMessage`
|
||
|
||
## Sécurité
|
||
- `ihm_client` valide l’origine et les tokens
|
||
- RN ne manipule pas directement les tokens côté page
|
||
|