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 have 2 tables: Task and User. The relationship between them is n-n, a user can be a host or participant of a task.
I used below function to query for the list of tasks of user with given userId. This function should return all tasks that this user created and tasks that other users added him as participant.
override fun getTaskList(userId: String): List<TaskDto> {
val user = ParseUser.createWithoutData("_User", userId)
val hostQuery = ParseQuery
.getQuery(TaskDto::class.java)
.whereEqualTo(TaskDto::host.name, user)
val participantQuery = ParseQuery
.getQuery(TaskDto::class.java)
.whereEqualTo(TaskDto::participants.name, user)
var compoundQuery = ParseQuery
.or(listOf(hostQuery, participantQuery))
.include(Task::participants.name)
.include(Task::host.name)
try {
val dataList = compoundQuery.find()
return dataList
} catch (e: ParseException) {
e.printStackTrace()
return emptyList()
}
}
The function work well on Android 5+, but on Android 4 (API 16), I can't get the tasks that given user is participant of. The data type of column participants is Array of Pointers. It contains value like this:
Assume user A logged in to Android-4 phone, and user B logged in to Android-5 phone. if A create a task and invite B as participant, both B and A can query it. but if B create a task and invite A as participant, only B can see.
I did debug and see that the participantQuery always return empty list on Android-4.
Did I do any mistake? Or is it a bug of Parse SDK?
The text was updated successfully, but these errors were encountered:
I have 2 tables: Task and User. The relationship between them is
n-n
, a user can be a host or participant of a task.I used below function to query for the list of tasks of user with given
userId
. This function should return all tasks that this user created and tasks that other users added him as participant.The function work well on Android 5+, but on Android 4 (API 16), I can't get the tasks that given user is participant of. The data type of column
participants
is Array of Pointers. It contains value like this:Assume user A logged in to Android-4 phone, and user B logged in to Android-5 phone. if A create a task and invite B as participant, both B and A can query it. but if B create a task and invite A as participant, only B can see.
I did debug and see that the
participantQuery
always return empty list on Android-4.Did I do any mistake? Or is it a bug of Parse SDK?
The text was updated successfully, but these errors were encountered: