I’m trying to setup live query into my app. I created a seperate server for live query. I enabled live query for my classes like this:
liveQuery: {
classNames: ['Chat', 'Message']
}
I’m using android SDK. Here is the code I use:
parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient(new URI("ws://ws-server.example.com:1337/parse"));
ParseQuery<Message> parseQuery = ParseQuery.getQuery(Message.class);
parseQuery.whereEqualTo("chat",chat);
SubscriptionHandling<Message> subscriptionHandling = parseLiveQueryClient.subscribe(parseQuery);
subscriptionHandling.handleEvent(SubscriptionHandling.Event.CREATE, new SubscriptionHandling.HandleEventCallback<Message>() {
@Override
public void onEvent(ParseQuery<Message> query, Message object) {
Log.e("LiveQuery",object.toString());
//Other logic
}
});
But I dont get live events. I can see in my parse server I connected succesfully. I get this message on console: Create new client: 0a8c1cf4-a0e2-42cb-a8d2-0ea8a17b4988
But ı dont get anything. I cant see my log.
Here is live query log:
V/ParseLiveQueryClient: Socket opened
V/ParseLiveQueryClient: Socket onMessage {"op":"connected","clientId":"aeff6f06-15b7-4102-bfe0-6b7d079dc0f6"}
V/ParseLiveQueryClient: Connected, sending pending subscription
V/ParseLiveQueryClient: Socket onMessage {"op":"subscribed","clientId":"aeff6f06-15b7-4102-bfe0-6b7d079dc0f6","requestId":1}
Objects has proper ACLs. I can read the objects that matches live query.
Whats the problem here?