-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rest: message encoding #95
Comments
@mattheworiordan I need some orientation with this. I don't know what makes sense or not. |
Message encoding
Payload encoding
Payload encryption (after encoding)
Test with presence fixtures Messages received:
|
@ricardopereira lets chat tomorrow, probably easier to talk this through. |
This has changed completely with #171. |
Add Swift and Obj-C versions of the docs.
I am implementing RSL4a.
Well, I dig into it and I found two places to setup the encoding (one for the payload and one for the client messages):
There are 4 payload encoders:
ARTBase64PayloadEncoder
ARTUtf8PayloadEncoder
ARTJsonPayloadEncoder
ARTCipherPayloadEncoder
and one
ARTPayloadEncoderChain
that allows "multi-encoding".ARTChannel
When a
ARTChannel
is created it uses a private payload encoder[ARTPayload defaultPayloadEncoder]
and I my opinion it is supposed to use the. The private payload encoder (ARTRest.defaultEncoder
ARTChannel.payloadEncoder
) is used to encode/decode the messages.The
[ARTPayload defaultPayloadEncoder]
is an[ARTJsonPayloadEncoder instance]
when thecipherParams
is empty. If it is not then it uses aARTPayloadEncoderChain
withARTJsonPayloadEncoder
,ARTUtf8PayloadEncoder
and finallyARTCipherPayloadEncoder
.ARTMessage
The
ARTMessage
when it is created it initialises the payload with an empty one where the encoding is nothing ([ARTPayload payloadWithPayload:data encoding:@""]
).ARTRest
The
defaultEncoder
is always anARTJsonEncoder
and it is used to publish a message ([rest.defaultEncoder encodeMessage:message]
).The text was updated successfully, but these errors were encountered: