You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
when i move back from current screen after unsubscribing and come back to same screen it invoking more than one time
isSubscribed = false;
if(!isSubscribed) {
isSubscribed = true;
sub = new BaseQuery.Builder("Message")
.addField("message")
.addField(MSG_RECEIVER_USER_ID)
.addField(MSG_SENDER_USER_ID)
.build()
.subscribe();
sub.on(LiveQueryEvent.CREATE, new OnListener() {
@Override
public void on(JSONObject object) {
Log.e(TAG, "on: " + object);
// Action to be executed here when an object that matches
// The filter you set up
}
});
}else{
if(sub != null){
if(sub.isSubscribed()){
sub.unsubscribe();
isSubscribed = false;
}
}
}
}
output (invoking more than one times)
on: {"op":"create","clientId":22,"requestId":2,"object":{"className":"Message",
"objectId":"MoItqxnFGC","updatedAt":"2017-02-27T10:37:08.679Z","createdAt":"2017-02-27T10:37:08.679Z","message":"dhjjf",
"receiver_user_id":"Rb4bg9Nv5z","sender_user_id":"ewaCQ6Y2I4"}}
on: {"op":"create","clientId":22,"requestId":2,"object":{"className":"Message",
"objectId":"MoItqxnFGC","updatedAt":"2017-02-27T10:37:08.679Z","createdAt":"2017-02-27T10:37:08.679Z","message":"dhjjf",
"receiver_user_id":"Rb4bg9Nv5z","sender_user_id":"ewaCQ6Y2I4"}}
Works fine
When I subscribe first time its work fine
Not working
when i move back from current screen after unsubscribing and come back to same screen it invoking more than one time