Location listener using React Native's headless JS
essamtarik / locationlistener Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://medium.com/@essamtarik2000/introduction-to-react-natives-headless-js-90e87dee0ab4
Home Page: https://medium.com/@essamtarik2000/introduction-to-react-natives-headless-js-90e87dee0ab4
Location listener using React Native's headless JS
My App is built successfully but when Starting the app it keeps stopping in android. My all code is same as yours except some version difference:
Package.json:
{
"name": "Chutiyapa",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.3.1",
"react-native": "0.55.4"
},
"devDependencies": {
"babel-jest": "23.6.0",
"babel-preset-react-native": "4.0.1",
"jest": "23.6.0",
"react-test-renderer": "16.3.1"
},
"jest": {
"preset": "react-native"
}
}
My android/app/build.gradle:
compileSdkVersion 23
buildToolsVersion "23.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "LocationListener"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.00"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
except this all other things are same
Hi Essam, thanks for the code, i run the code on my local machine using an emulator (Google Nexus 5), and i run react-native log-android command on my console to view the output. It is logging well when i change the location GPS, but it didnt work when i press the home button to put the app on the background. Do i miss out on anything here? Thanks again
I tried to minimize the app and it stops working after some time , if I want to track location continuously what should I do?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.