centrifugal / centrifuge-swift

Swift client SDK for bidirectional real-time communication with Centrifugo and Centrifuge-based server over WebSocket
MIT License
47 stars 41 forks source link

CentrifugeConnectEvent has not data property #66

Closed shalom-aviv closed 2 years ago

shalom-aviv commented 2 years ago

Delegate.swift:

//...
public struct CentrifugeConnectEvent {
    public var client: String
}
//...

Specification Connect result fields:

Field Type Optional Description
data JSON yes a custom data to send to the client in connect command response.

In Java all is OK ;)

ConnectEvent.java

package io.github.centrifugal.centrifuge;

public class ConnectEvent {
    public String getClient() {
        return client;
    }

    void setClient(String client) {
        this.client = client;
    }

    public byte[] getData() {
        return data;
    }

    void setData(byte[] data) {
        this.data = data;
    }

    private String client;
    private byte[] data;
}

The same situation in dart library, but not in swift

FZambia commented 2 years ago

Hello @shalom-aviv

Thanks, yeah, I noticed this and fixed while working on #58 (code). But that PR changes lots of things and will land a bit later (part of https://github.com/centrifugal/centrifugo/issues/500) – so for now we still need to support this field separately in current master.

Do you want to send PR supporting this? If not - I'll be able to add the missing field at some point (hopefully this week).

shalom-aviv commented 2 years ago

Please review my changes in pull request: https://github.com/centrifugal/centrifuge-swift/pull/67

Thank you

FZambia commented 2 years ago

Thanks! Just released 0.4.6

shalom-aviv commented 2 years ago

Awesome! You are very speedy! Thanks