Module Veery

getPois(callback)

Get the list of last known POIs of the user.

Parameters

Param name Type Usage
callback function return Veery.Pois

Returns

none

Usage / Example

        import React, { Component } from 'react';
        import {Platform,StyleSheet,Text,Button,View} from 'react-native';
        import Veery from 'react-native-veery';

        export default class App extends Component<{}> {

            componentWillMount(){
                        Veery.serviceConnect();
                        Veery.setApiKeySecret('SuPeRScrET12345789GhJ');
                        //
                        Veery.activate(Veery.GEOPROFILE);
                        // Requires react-native-veery 1.4.4 or higher
                        //  Veery.activate(Veery.BACKGROUND_GEOLOC | Veery.POINT_OF_INTEREST);
                    }

            getpois(){
                    Veery.requestPoiUpdate();
                Veery.getPois(
                      (pois) => {
                        if (pois !== null) {
                              console.log('Pois callback App.js==pois.toArray()===> end',pois.toArray());
                              console.log('Pois callback App.js==pois.toGeoJSONArray()===> end',pois.toGeoJSONArray());
                              console.log('Pois callback App.js==pois.count()===> end',pois.count());

                          if (pois.count()>0) {
                            for(var i=0;i<pois.count();i++){
                              console.log('Pois callback App.js==pois.getWeight() ['+i+']===>',pois.getWeight(i));
                            }
                          }
                        }
              });
                }

            render() {
                return(
                        <View >
                            <Text > Welcome to VeeryDemoReactNative!</Text>
                            <Button
                                onPress = {this.getpois}
                                title="Get Pois"
                                color="#8FFF04"/>
                        </View>
                    );}
            }

User interaction

none

See also

getPois

Get last known list of POIs for that user.

requestPoiUpdate

Request for a callback event when a new set of POIs is computed by the Veery Backend.

stopPoiUpdate

Cancel the call to requestPoiUpdate.

Pois.toArray

Return an array of CLLocationCoordinate2D object.

Pois.toGeoJSONArray

Return an array of GeoJSON (circles around the POIs).

Pois.count

Return the amount of POIs known.

Pois.getWeight

Return the percentage of time spent at the specified POI.

veeryPoiUpdate

Callback triggered every time a new set of POIs is computed by the Veery backend.