OneViewrRestClient class

Client des routes REST publiques d'Oneviewr (com.oneviewr.crm.publicapi.PublicIngestController, base /api/v1/public) : POST /identify, POST /events, PUT /push-tokens, DELETE /push-tokens/{token}, POST /deep-link/resolve.

Ne connaît ni Flutter ni l'état du paquet : on lui donne une base résolue et une clé publique, il parle HTTP — même séparation des responsabilités que ChatRestClient côté onex, ce qui permet de le tester contre un vrai serveur sans passer par la façade OneViewr.

Constructors

OneViewrRestClient({required String publicKey, OneViewrEnv? env, String? apiBase, Dio? dio})
Construit un client visant l'environnement/la base donnés, authentifié par publicKey.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

ackInAppMessage(String messageId, Map<String, dynamic> body) → Future<void>
Accuse réception d'un événement de message in-app (POST /in-app-messages/{messageId}/ack) — body['event'] ∈ {'SHOWN','CLICKED','DISMISSED'}. Le serveur ne renvoie aucun corps utile ; le résultat de post est ignoré ici plutôt qu'exposé pour rien.
ackMessage(String messageId, Map<String, dynamic> body) → Future<void>
Channel-neutral twin of ackInAppMessage (POST /messages/{messageId}/ack, same request shape) — used by OneViewr.trackNotificationClick for a PUSH notification-click ack. Same underlying backend service as /in-app-messages/{id}/ack (never branches on the message's channel), just a route name that doesn't lie for a PUSH integrator.
answerInAppSurvey(String messageId, Map<String, dynamic> body) → Future<void>
Envoie les réponses d'un sondage (POST /in-app-messages/{messageId}/ answer, bloc interactif) — body['answers'] porte les POSITIONS des choix, jamais leurs libellés. Le serveur répond 204 sans corps ; la première réponse l'emporte, les suivantes sont sans effet.
close() → void
Libère le client HTTP sous-jacent.
delete(String path) → Future<void>
DELETE sans corps.
fetchPendingInAppMessage(Map<String, dynamic> body) → Future<Map<String, dynamic>?>
Réclame le message in-app en attente pour l'identité donnée (POST /in-app-messages/pending) — voir InAppMessageQueryService côté backend, qui exécute une réclamation atomique (FOR UPDATE SKIP LOCKED) plutôt qu'une simple lecture. Renvoie null si aucun message n'est en attente (202/204 sans corps), jamais une erreur pour ce cas normal.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post(String path, Map<String, dynamic> body) → Future<Map<String, dynamic>?>
POST avec corps JSON. Renvoie le corps décodé, ou null si la réponse n'en a pas (202/204).
put(String path, Map<String, dynamic> body) → Future<Map<String, dynamic>?>
PUT avec corps JSON.
Retrouve un lien d'acquisition (POST /deep-link/resolve) : {token} (iOS, jeton du presse-papiers) ou {code, attemptId} (Android, ou une application déjà installée), avec platform facultatif. Toujours 200 avec un resolutionStatus — voir DeepLink.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited