Scarlet
Scarlet copied to clipboard
Gson adapter not work
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 ?
Similiar to https://github.com/Tinder/Scarlet/issues/37