parse-community / ParseLiveQuery-Android

Parse LiveQuery client for Android.
Other
84 stars 32 forks source link

SubscriptionHandling handleEvents not being invoked for _User table #97

Closed developer-- closed 5 years ago

developer-- commented 5 years ago

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")
        }
      }
    }
  }

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

developer-- commented 5 years ago

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:)

mmimeault commented 5 years ago

Awesome, thanks for the update