Geolocation nanoflow resources

0
Hi all, In a nano flow i’m using the java action ‘get location’ from the nanoflow resources module.  When i run the app on the make it native application i get this this error below   Error occurred while executing an action of InCab_Native.PAGE_AssistedCollection.actionButton1: undefined is not an object (evaluating 'navigator.geolocation.getCurrentPosition') http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:134456:157 executeAction@http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:54223:22 res@http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:54197:27 handleError@http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:134663:20 tryCallOne@http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:13874:16 http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:13975:27 _callTimer@http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:22950:17 _callImmediatesPass@http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:22986:19 callImmediates@http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:23205:33 callImmediates@[native code] __callImmediates@http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:13352:35 http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:13129:34 __guard@http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:13335:15 flushedQueue@http://192.168.1.36:8083/index.bundle?platform=android&dev=true&minify=false:13128:21 flushedQueue@[native code] invokeCallbackAndReturnFlushedQueue@[native code   Is there another way to get the devices location long/lat? I’ll be using the google matrix API to compare distances to the mobiles location.
asked
2 answers
0

There's no other way available out-of-the-box. Make sure your phone has location services turned on, and your user has access to the geolocation entity in the nanoflow commons module. The JSA does also have the tendency to throw an error at certain settings, so you could try out some different settings as well.

answered
0

One option is to use the same service as used in the FitnessTracker app. Info from Jan de Vries: “Watch the fitness app webinar recording here! https://www.youtube.com/watch?v=nO7UYzGqc6Y It includes a link to the project files as well so you can build the app yourself”
It uses a geolocation service that is called using native react.

import BackgroundGeolocation from '@mauron85/react-native-background-geolocation';

 

answered