public void unsubscribeInBackground ( final AVLiveQuerySubscribeCallback callback ) { Map < String , Object > map = new HashMap <> ( ) ; map . put ( SUBSCRIBE_ID , getSubscribeId ( ) ) ; map . put ( QUERY_ID , queryId ) ; RealtimeClient . getInstance ( ) . unsubscribeLiveQuery ( map ) . subscribe ( new Observer < JSONObject > ( ) { @ Override public void onSubscribe ( Disposable disposable ) { } @ Override public void onNext ( JSONObject jsonObject ) { liveQuerySet . remove ( AVLiveQuery . this ) ; queryId = "" ; if ( null != callback ) { callback . internalDone ( null ) ; } } @ Override public void onError ( Throwable throwable ) { if ( null != callback ) { callback . internalDone ( new AVException ( throwable ) ) ; } } @ Override public void onComplete ( ) { } } ) ; }
unsubscribe the query