ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
124 stars 111 forks source link

How to sort by custom data: Location on the react native SDK #216

Closed onursezn closed 3 years ago

onursezn commented 3 years ago

Is there any example request that I can use for the sorting by custom data: Location on the react-native SDK? Any help would be appreciated. Thanks.

DaveLomber commented 3 years ago

@onursezn are you looking for sorting by 'nearest' ?

Then please use 'near' filter

https://developers.connectycube.com/server/custom_objects?id=_1-sorting

alperbilgic commented 3 years ago

@DaveLomber I also have some issues. The problem is that the given document does not describe the request data well. Should it be in json form and be like:

{
   'near': {
                  <field_name>: [latitude, longitude],
                  radius: 19999
    }
}
DaveLomber commented 3 years ago

@alperbilgic right, everything in JavaScript should be a JSON ;-D

alperbilgic commented 3 years ago

@DaveLomber Sir I also need to know the structure of the JSON object.

{
   'near': {
                  <field_name>: [latitude, longitude],
                  radius: 19999
    }
}

Is this structure in the right form? Are the field names and the value types that are passed correct?

DaveLomber commented 3 years ago

Yes this is correct