Search code examples
androidparse-platform

Parse SubscriptionHandling handleEvents not being invoked for _User table


I'm trying to subscribe changes in _User table, but when I'm changing somethings in _User table handleEvents not invoked,here is how I'm doing that:

  private var parseLiveQueryClient: ParseLiveQueryClient? = ParseLiveQueryClient.Factory.getClient()
  private var subscriptionHandling: SubscriptionHandling<ParseUser>? = null
  private val livePointQuery = ParseUser.getQuery()

  init {
      subscriptionHandling = parseLiveQueryClient?.subscribe(livePointQuery)
      subscriptionHandling?.handleSubscribe {
        if (it != null){
          Log.e("LIVE_QUERY","success") // invoked successfully 
        }else{
          Log.e("LIVE_QUERY","null")
        }

      subscriptionHandling?.handleEvents { _, event, parseUser ->
        Log.e("LIVE_QUERY_EVENT","${event.name}")
        if(parseUser != null){
          Log.e("LIVE_QUERY",parseUser.objectId)
        }else{
          Log.e("LIVE_QUERY","user null")
        }
      }
    }
  }

Logcat result:

ParseLiveQueryClient: Socket onMessage {"op":"subscribed","clientId":163,"requestId":1}

P.S, I'm successfully subscribing other table data updates, ex: Chat.

I have also opened the issue to parse-community/ParseLiveQuery-Android


Solution

  • Solved! The problem were not in client side code, that was on server side configuration, _User class didn't have LiveQuery enabled, after enabling I got updates:)