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
I'm making a Live Query subscription when a new message is created. Problem is parseQuery.include("sender") is not working as intended. Therefore, print(sender.getString("username")!!) fires an error because username field does not exist.
val parseQuery = ParseQuery.getQuery<ParseObject>("messages")
parseQuery.include("sender")
val subscriptionHandling: SubscriptionHandling<ParseObject> = app.parseLiveQueryClient!!.subscribe(parseQuery)
subscriptionHandling.handleEvent(SubscriptionHandling.Event.CREATE) { query, `object` ->
val handler = Handler(Looper.getMainLooper())
handler.post {
val message = `object` as ParseObject
val sender = `object`.getParseObject("sender") as ParseUser
print(sender.getString("username")!!)
}
}
My Messages class has 'sender' as a Pointer to _User's objectId.
The text was updated successfully, but these errors were encountered:
I'm making a Live Query subscription when a new message is created. Problem is
parseQuery.include("sender")
is not working as intended. Therefore,print(sender.getString("username")!!)
fires an error because username field does not exist.My Messages class has 'sender' as a Pointer to _User's objectId.
The text was updated successfully, but these errors were encountered: