React Native

Using React Native geolocation to perform geoqueries using Parse

Introduction

In this guide, you will perform geoqueries in Parse using the React Native geolocation. You will implement a React Native component using these queries and learn how to set up and query realistic data using Back4App and React Native.

Prerequisites

To complete this tutorial, you will need:

Goal

Perform Geoqueries using geopoints stored on Back4App and React Native geolocation.

Step 1 - Understanding the Parse.Query class

Any Parse query operation uses the Parse.Query object type, which will help you retrieve specific data from your database throughout your app. It is crucial to know that a Parse.Query will only resolve after calling a retrieve method (like Parse.Query.find or Parse.Query.get), so a query can be set up and several modifiers can be chained before actually being called.

To create a new Parse.Query, you need to pass as a parameter the desired Parse.Object subclass, which is the one that will contain your query results. An example query can be seen below, in which a fictional Profile subclass is being queried.

1
2
3
4
// This will create your query
let parseQuery = new Parse.Query("Profile");
// The query will resolve only after calling this method
let queryResult = await parseQuery.find();

You can read more about the Parse.Query class here at the official documentation.

Step 2 - Save some data on Back4App

Let’s create a City class, which will be the target of our queries in this guide. On Parse JS Console is possible to run JavaScript code directly, querying and updating your application database contents using the JS SDK commands. Run the code below from your JS Console and insert the data on Back4App.

Here is how the JS Console looks like in your dashboard:

React Native Back4App

Go ahead and create the City class with the following example content:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Add City objects and create table
// Note how GeoPoints are created, passing latitude and longitude as arguments
// Montevideo
City = new Parse.Object('City');
City.set('name', 'Montevideo - Uruguay');
City.set('location', new Parse.GeoPoint(-34.85553195363169, -56.207280375137955));
await City.save();

// Brasília
City = new Parse.Object('City');
City.set('name', 'Brasília - Brazil');
City.set('location', new Parse.GeoPoint(-15.79485821477289, -47.88391074690196));
await City.save();

// Bogotá
City = new Parse.Object('City');
City.set('name', 'Bogotá - Colombia');
City.set('location', new Parse.GeoPoint(4.69139880891712, -74.06936691331047));
await City.save();

// Mexico City
City = new Parse.Object('City');
City.set('name', 'Mexico City - Mexico');
City.set('location', new Parse.GeoPoint(19.400977162618933, -99.13311378164776));
await City.save();

// Washington, D.C.
City = new Parse.Object('City');
City.set('name', 'Washington, D.C. - USA');
City.set('location', new Parse.GeoPoint(38.930727220189944, -77.04626261880388));
await City.save();

// Ottawa
City = new Parse.Object('City');
City.set('name', 'Ottawa - Canada');
City.set('location', new Parse.GeoPoint(45.41102167733425, -75.695414598736));
await City.save();

console.log('Success!');

Step 3 - Query the data

Now that you have a populated class, we can now perform some GeoPoint queries in it. Let’s begin by ordering City results by the nearest from Kingston in Jamaica (latitude 18.01808695059913 and longitude -76.79894232253473), using the Parse.Query.near method:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Create your query
let parseQuery = new Parse.Query('City');

// Create our GeoPoint for the query
let kingstonGeoPoint = new Parse.GeoPoint(18.018086950599134, -76.79894232253473);

// `near` will order results based on distance between the GeoPoint type field from the class and the GeoPoint argument
parseQuery.near('location', kingstonGeoPoint);

// The query will resolve only after calling this method, retrieving
// an array of `Parse.Objects`
let queryResults = await parseQuery.find();

// Let's show the results
for (let result of queryResults) {
  // You access `Parse.Objects` attributes by using `.get`
  console.log(result.get('name'));
};

Let’s now query using the method Parse.Query.withinKilometers, which will retrieve all results whose GeoPoint field is located within the max distance. Kingston will be used once again as a reference and the distance limit will be 3000 km.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Create your query
let parseQuery = new Parse.Query('City');

// Create our GeoPoint for the query
let kingstonGeoPoint = new Parse.GeoPoint(18.018086950599134, -76.79894232253473);

// You can also use `withinMiles` and `withinRadians` the same way,
// but with different measuring unities
parseQuery.withinKilometers('location', kingstonGeoPoint, 3000);

// The query will resolve only after calling this method, retrieving
// an array of `Parse.Objects`
let queryResults = await parseQuery.find();

// Let's show the results
for (let result of queryResults) {
  // You access `Parse.Objects` attributes by using `.get`
  console.log(result.get('name'));
};

Another useful query method is Parse.Query.withinPolygon, which will query results whose GeoPoint field value is within the specified polygon, composed of an array of GeoPoints (at least three). If the polygon path is open, it will be closed automatically by Parse connecting the last and first points.
For this example, you will be using a simple polygon that roughly contains the South American continent, composed of 5 distant GeoPoints in the ocean.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Create your query
let parseQuery = new Parse.Query('City');

// Create our GeoPoint polygon for the query
let geoPoint1 = new Parse.GeoPoint(15.822238344514378, -72.42845934415942);
let geoPoint2 = new Parse.GeoPoint(-0.7433770196268968, -97.44765968406668);
let geoPoint3 = new Parse.GeoPoint(-59.997149373299166, -76.52969196322749);
let geoPoint4 = new Parse.GeoPoint(-9.488786415007201, -18.346101586021952);
let geoPoint5 = new Parse.GeoPoint(15.414859532811047, -60.00625459569375);

// Note that the polygon is merely an array of GeoPoint objects and that the first and last are not connected, so Parse connects them for you
parseQuery.withinPolygon('location', [geoPoint1, geoPoint2, geoPoint3, geoPoint4, geoPoint5]);

// The query will resolve only after calling this method, retrieving
// an array of `Parse.Objects`
let queryResults = await parseQuery.find();

// Let's show the results
for (let result of queryResults) {
  // You access `Parse.Objects` attributes by using `.get`
  console.log(result.get('name'));
};

Step 4 - Query from a React Native component

Let’s now use our example queries inside a component in React Native, with a simple interface having a list showing results and also 3 buttons for calling the queries. The component also retrieves the device’s current location using react-native-geolocation-service, so the queries will be using real data.

This is how the component code is laid out, note the doQuery functions, containing the example code form before.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
import React, {useState} from 'react';
import {
  Alert,
  Image,
  View,
  PermissionsAndroid,
  Platform,
  ScrollView,
  StyleSheet,
} from 'react-native';
import Parse from 'parse/react-native';
import {
  List,
  Title,
  Button as PaperButton,
  Text as PaperText,
} from 'react-native-paper';
import Geolocation from 'react-native-geolocation-service';

export const QueryList = () => {
  // State variable
  const [queryResults, setQueryResults] = useState(null);

  // This function asks for location permission on iOS and Android
  const requestLocationPermissions = async () => {
    if (Platform.OS === 'ios') {
      // iOS can be asked always, since the OS handles if user already gave permission
      await Geolocation.requestAuthorization('whenInUse');
    } else if (Platform.OS === 'android') {
      let permissionCheck = await PermissionsAndroid.check(
        PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
      );
      // Only asks for permission on Android if not given before
      if (permissionCheck !== true) {
        await PermissionsAndroid.request(
          PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
          {
            title: 'Location Permission Request',
            message:
              'This app needs you permission for using your location for querying GeoPoints in Parse!',
            buttonPositive: 'OK',
          },
        );
      }
    }
  };

  const doQueryNear = async function () {
    // Request location permissions
    await requestLocationPermissions();
    // Get current location and create the GeoPoint for the query
    Geolocation.getCurrentPosition(
      async (currentPosition) => {
        // Create our GeoPoint
        let currentLocationGeoPoint = new Parse.GeoPoint(
          currentPosition.coords.latitude,
          currentPosition.coords.longitude,
        );

        // Create our query
        let parseQuery = new Parse.Query('City');

        // `near` will order results based on distance between the GeoPoint type field from the class and the GeoPoint argument
        parseQuery.near('location', currentLocationGeoPoint);

        try {
          let results = await parseQuery.find();
          // Set query results to state variable
          setQueryResults(results);
        } catch (error) {
          // Error can be caused by lack of Internet connection
          Alert.alert('Error!', error.message);
        }
      },
      _error => {
        Alert.alert(
          'Error!',
          'This app needs your location permission to query this!',
        );
      },
      {enableHighAccuracy: true, timeout: 15000, maximumAge: 10000},
    );
    return true;
  };

  const doQueryWithinKilometers = async function () {
    // Request location permissions
    await requestLocationPermissions();
    // Get current location and create the GeoPoint for the query
    Geolocation.getCurrentPosition(
      async (currentPosition) => {
        // Create our GeoPoint
        let currentLocationGeoPoint = new Parse.GeoPoint(
          currentPosition.coords.latitude,
          currentPosition.coords.longitude,
        );

        // Create our query
        let parseQuery = new Parse.Query('City');

        // You can also use `withinMiles` and `withinRadians` the same way,
        // but with different measuring unities
        parseQuery.withinKilometers('location', currentLocationGeoPoint, 3000);

        try {
          let results = await parseQuery.find();
          // Set query results to state variable
          setQueryResults(results);
        } catch (error) {
          // Error can be caused by lack of Internet connection
          Alert.alert('Error!', error.message);
        }
      },
      _error => {
        Alert.alert(
          'Error!',
          'This app needs your location permission to query this!',
        );
      },
      {enableHighAccuracy: true, timeout: 15000, maximumAge: 10000},
    );
    return true;
  };

  const doQueryWithinPolygon = async function () {
    // Create our GeoPoint polygon points
    let geoPoint1 = new Parse.GeoPoint(15.822238344514378, -72.42845934415942);
    let geoPoint2 = new Parse.GeoPoint(-0.7433770196268968, -97.44765968406668);
    let geoPoint3 = new Parse.GeoPoint(-59.997149373299166, -76.52969196322749);
    let geoPoint4 = new Parse.GeoPoint(-9.488786415007201, -18.346101586021952);
    let geoPoint5 = new Parse.GeoPoint(15.414859532811047, -60.00625459569375);

    // Create our query
    let parseQuery = new Parse.Query('City');

    // Note that the polygon is merely an array of GeoPoint objects and that the first and last are not connected, so Parse connects them for you
    parseQuery.withinPolygon('location', [
      geoPoint1,
      geoPoint2,
      geoPoint3,
      geoPoint4,
      geoPoint5,
    ]);

    try {
      let results = await parseQuery.find();
      // Set query results to state variable
      setQueryResults(results);
    } catch (error) {
      // Error can be caused by lack of Internet connection
      Alert.alert('Error!', error.message);
    }
  };

  const clearQueryResults = async function () {
    setQueryResults(null);
    return true;
  };

  return (
    <>
      <View style={Styles.header}>
        <Image
          style={Styles.header_logo}
          source={ {
            uri:
              'https://blog.back4app.com/wp-content/uploads/2019/05/back4app-white-logo-500px.png',
          } }
        />
        <PaperText style={Styles.header_text}>
          <PaperText style={Styles.header_text_bold}>
            {'React Native on Back4App - '}
          </PaperText>
          {' GeoPoint Queries'}
        </PaperText>
      </View>
      <ScrollView style={Styles.wrapper}>
        <View>
          <Title>{'Result List'}</Title>
          {/* Query list */}
          {queryResults !== null &&
            queryResults !== undefined &&
            queryResults.map((result) => (
              <List.Item
                key={result.id}
                title={result.get('name')}
                titleStyle={Styles.list_text}
                style={Styles.list_item}
              />
            ))}
          {queryResults === null ||
          queryResults === undefined ||
          (queryResults !== null &&
            queryResults !== undefined &&
            queryResults.length <= 0) ? (
            <PaperText>{'No results here!'}</PaperText>
          ) : null}
        </View>
        <View>
          <Title>{'Query buttons'}</Title>
          <PaperButton
            onPress={() => doQueryNear()}
            mode="contained"
            icon="search-web"
            color={'#208AEC'}
            style={Styles.list_button}>
            {'Query Near'}
          </PaperButton>
          <PaperButton
            onPress={() => doQueryWithinKilometers()}
            mode="contained"
            icon="search-web"
            color={'#208AEC'}
            style={Styles.list_button}>
            {'Query Within KM'}
          </PaperButton>
          <PaperButton
            onPress={() => doQueryWithinPolygon()}
            mode="contained"
            icon="search-web"
            color={'#208AEC'}
            style={Styles.list_button}>
            {'Query Within Polygon'}
          </PaperButton>
          <PaperButton
            onPress={() => clearQueryResults()}
            mode="contained"
            icon="delete"
            color={'#208AEC'}
            style={Styles.list_button}>
            {'Clear Results'}
          </PaperButton>
        </View>
      </ScrollView>
    </>
  );
};

// These define the screen component styles
const Styles = StyleSheet.create({
  header: {
    alignItems: 'center',
    paddingTop: 30,
    paddingBottom: 50,
    backgroundColor: '#208AEC',
  },
  header_logo: {
    height: 50,
    width: 220,
    resizeMode: 'contain',
  },
  header_text: {
    marginTop: 15,
    color: '#f0f0f0',
    fontSize: 16,
  },
  header_text_bold: {
    color: '#fff',
    fontWeight: 'bold',
  },
  wrapper: {
    width: '90%',
    alignSelf: 'center',
  },
  list_button: {
    marginTop: 6,
    marginLeft: 15,
    height: 40,
  },
  list_item: {
    borderBottomWidth: 1,
    borderBottomColor: 'rgba(0, 0, 0, 0.12)',
  },
  list_text: {
    fontSize: 15,
  },
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
import React, {FC, ReactElement, useState} from 'react';
import {
  Alert,
  Image,
  View,
  PermissionsAndroid,
  Platform,
  ScrollView,
  StyleSheet,
} from 'react-native';
import Parse from 'parse/react-native';
import {
  List,
  Title,
  Button as PaperButton,
  Text as PaperText,
} from 'react-native-paper';
import Geolocation from 'react-native-geolocation-service';

export const QueryList: FC<{}> = ({}): ReactElement => {
  // State variable
  const [queryResults, setQueryResults] = useState(null);

  // This function asks for location permission on iOS and Android
  const requestLocationPermissions = async () => {
    if (Platform.OS === 'ios') {
      // iOS can be asked always, since the OS handles if user already gave permission
      await Geolocation.requestAuthorization('whenInUse');
    } else if (Platform.OS === 'android') {
      let permissionCheck: boolean = await PermissionsAndroid.check(
        PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
      );
      // Only asks for permission on Android if not given before
      if (permissionCheck !== true) {
        await PermissionsAndroid.request(
          PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
          {
            title: 'Location Permission Request',
            message:
              'This app needs you permission for using your location for querying GeoPoints in Parse!',
            buttonPositive: 'OK',
          },
        );
      }
    }
  };

  const doQueryNear = async function (): Promise<boolean> {
    // Request location permissions
    await requestLocationPermissions();
    // Get current location and create the GeoPoint for the query
    Geolocation.getCurrentPosition(
      async (currentPosition: {
        coords: {latitude: number; longitude: number};
      }) => {
        // Create our GeoPoint
        let currentLocationGeoPoint: Parse.GeoPoint = new Parse.GeoPoint(
          currentPosition.coords.latitude,
          currentPosition.coords.longitude,
        );

        // Create our query
        let parseQuery: Parse.Query = new Parse.Query('City');

        // `near` will order results based on distance between the GeoPoint type field from the class and the GeoPoint argument
        parseQuery.near('location', currentLocationGeoPoint);

        try {
          let results: [Parse.Object] = await parseQuery.find();
          // Set query results to state variable
          setQueryResults(results);
        } catch (error) {
          // Error can be caused by lack of Internet connection
          Alert.alert('Error!', error.message);
        }
      },
      _error => {
        Alert.alert(
          'Error!',
          'This app needs your location permission to query this!',
        );
      },
      {enableHighAccuracy: true, timeout: 15000, maximumAge: 10000},
    );
    return true;
  };

  const doQueryWithinKilometers = async function (): Promise<boolean> {
    // Request location permissions
    await requestLocationPermissions();
    // Get current location and create the GeoPoint for the query
    Geolocation.getCurrentPosition(
      async (currentPosition: {
        coords: {latitude: number; longitude: number};
      }) => {
        // Create our GeoPoint
        let currentLocationGeoPoint: Parse.GeoPoint = new Parse.GeoPoint(
          currentPosition.coords.latitude,
          currentPosition.coords.longitude,
        );

        // Create our query
        let parseQuery: Parse.Query = new Parse.Query('City');

        // You can also use `withinMiles` and `withinRadians` the same way,
        // but with different measuring unities
        parseQuery.withinKilometers('location', currentLocationGeoPoint, 3000);

        try {
          let results: [Parse.Object] = await parseQuery.find();
          // Set query results to state variable
          setQueryResults(results);
        } catch (error) {
          // Error can be caused by lack of Internet connection
          Alert.alert('Error!', error.message);
        }
      },
      _error => {
        Alert.alert(
          'Error!',
          'This app needs your location permission to query this!',
        );
      },
      {enableHighAccuracy: true, timeout: 15000, maximumAge: 10000},
    );
    return true;
  };

  const doQueryWithinPolygon = async function (): Promise<boolean> {
    // Create our GeoPoint polygon points
    let geoPoint1: Parse.GeoPoint = new Parse.GeoPoint(
      15.822238344514378,
      -72.42845934415942,
    );
    let geoPoint2: Parse.GeoPoint = new Parse.GeoPoint(
      -0.7433770196268968,
      -97.44765968406668,
    );
    let geoPoint3: Parse.GeoPoint = new Parse.GeoPoint(
      -59.997149373299166,
      -76.52969196322749,
    );
    let geoPoint4: Parse.GeoPoint = new Parse.GeoPoint(
      -9.488786415007201,
      -18.346101586021952,
    );
    let geoPoint5: Parse.GeoPoint = new Parse.GeoPoint(
      15.414859532811047,
      -60.00625459569375,
    );

    // Create our query
    let parseQuery: Parse.Query = new Parse.Query('City');

    // Note that the polygon is merely an array of GeoPoint objects and that the first and last are not connected, so Parse connects them for you
    parseQuery.withinPolygon('location', [
      geoPoint1,
      geoPoint2,
      geoPoint3,
      geoPoint4,
      geoPoint5,
    ]);

    try {
      let results: [Parse.Object] = await parseQuery.find();
      // Set query results to state variable
      setQueryResults(results);
    } catch (error) {
      // Error can be caused by lack of Internet connection
      Alert.alert('Error!', error.message);
    }
  };

  const clearQueryResults = async function (): Promise<boolean> {
    setQueryResults(null);
    return true;
  };

  return (
    <>
      <View style={Styles.header}>
        <Image
          style={Styles.header_logo}
          source={ {
            uri:
              'https://blog.back4app.com/wp-content/uploads/2019/05/back4app-white-logo-500px.png',
          } }
        />
        <PaperText style={Styles.header_text}>
          <PaperText style={Styles.header_text_bold}>
            {'React Native on Back4App - '}
          </PaperText>
          {' GeoPoint Queries'}
        </PaperText>
      </View>
      <ScrollView style={Styles.wrapper}>
        <View>
          <Title>{'Result List'}</Title>
          {/* Query list */}
          {queryResults !== null &&
            queryResults !== undefined &&
            queryResults.map((result: Parse.Object) => (
              <List.Item
                key={result.id}
                title={result.get('name')}
                titleStyle={Styles.list_text}
                style={Styles.list_item}
              />
            ))}
          {queryResults === null ||
          queryResults === undefined ||
          (queryResults !== null &&
            queryResults !== undefined &&
            queryResults.length <= 0) ? (
            <PaperText>{'No results here!'}</PaperText>
          ) : null}
        </View>
        <View>
          <Title>{'Query buttons'}</Title>
          <PaperButton
            onPress={() => doQueryNear()}
            mode="contained"
            icon="search-web"
            color={'#208AEC'}
            style={Styles.list_button}>
            {'Query Near'}
          </PaperButton>
          <PaperButton
            onPress={() => doQueryWithinKilometers()}
            mode="contained"
            icon="search-web"
            color={'#208AEC'}
            style={Styles.list_button}>
            {'Query Within KM'}
          </PaperButton>
          <PaperButton
            onPress={() => doQueryWithinPolygon()}
            mode="contained"
            icon="search-web"
            color={'#208AEC'}
            style={Styles.list_button}>
            {'Query Within Polygon'}
          </PaperButton>
          <PaperButton
            onPress={() => clearQueryResults()}
            mode="contained"
            icon="delete"
            color={'#208AEC'}
            style={Styles.list_button}>
            {'Clear Results'}
          </PaperButton>
        </View>
      </ScrollView>
    </>
  );
};

// These define the screen component styles
const Styles = StyleSheet.create({
  header: {
    alignItems: 'center',
    paddingTop: 30,
    paddingBottom: 50,
    backgroundColor: '#208AEC',
  },
  header_logo: {
    height: 50,
    width: 220,
    resizeMode: 'contain',
  },
  header_text: {
    marginTop: 15,
    color: '#f0f0f0',
    fontSize: 16,
  },
  header_text_bold: {
    color: '#fff',
    fontWeight: 'bold',
  },
  wrapper: {
    width: '90%',
    alignSelf: 'center',
  },
  list_button: {
    marginTop: 6,
    marginLeft: 15,
    height: 40,
  },
  list_item: {
    borderBottomWidth: 1,
    borderBottomColor: 'rgba(0, 0, 0, 0.12)',
  },
  list_text: {
    fontSize: 15,
  },
});

This is how the component should look like after rendering and querying one of the query functions:

React Native Back4App

Conclusion

At the end of this guide, you learned how GeoPoint data queries work on Parse and how to perform them on Back4App from a React Native App. In the next guide, you will check how to create and manage users in Parse.