Scarlet icon indicating copy to clipboard operation
Scarlet copied to clipboard

Gson adapter not work

Open mrkazansky opened this issue 6 years ago • 1 comments

I have Service like this :

`public interface SocketService {

@Send
void send(String message);

@Receive
Flowable<SocketMT> observerSocketMessage();

@Receive
Flowable<String> observerSocketString();

@Receive
Flowable<Event> observeEvent();

}`

The problem is observerSocketMessage() not work, but observerSocketString() work properly, i have init Scarlet Instance and POJO like this :

new Scarlet.Builder() .webSocketFactory(OkHttpClientUtils.newWebSocketFactory(provideSocketOkHttpClient(),"wss://echo.websocket.org")) .addMessageAdapterFactory(new GsonMessageAdapter.Factory()) .addStreamAdapterFactory(new RxJava2StreamAdapterFactory()) .build()

`public class SocketMT { @SerializedName("t") @Expose private String t; @SerializedName("d") @Expose private String d;

public SocketMT() {
}

public SocketMT(String t, String d) {
    this.t = t;
    this.d = d;
}

public String getT() {
    return t;
}

public void setT(String t) {
    this.t = t;
}

public String getD() {
    return d;
}

public void setD(String d) {
    this.d = d;
}

}`

Anybody know why ?

mrkazansky avatar May 09 '19 15:05 mrkazansky

Similiar to https://github.com/Tinder/Scarlet/issues/37

Chesteer89 avatar Jul 02 '19 06:07 Chesteer89