I can't seem to find any supporting documentation in the Expo docs or React Native docs that say whether or not this is possible, so I figured I'd ask here.
I'm creating an app that needs to periodically fetch the device's location, whether the app is in the foreground, background, but most important even if it's killed. Even a few times an hour is fine.
Do both Android and iOS even support this behaviour? And if so, can someone point me in the right direction or provide the class/API that I would need to make use of in Expo/React Native (ideally in Expo) that would allow me to fetch the device's location periodically even if the app is killed?
Thank you!
Generally speaking, yes, it should be possible.
On Android, this is generally possible using a Broadcast Reciever (and see the information there regarding getting user's location up from API 28).
On iOS, this is specifically possible using the Standard Location Service (specifically refer to the section "Getting Location Events in the Background").
Focusing on React Native, then again - focusing on Expo, there is a recent post discussing just that:
The best way of tracking location in background using react-native + Expo in 2020. However, the comments there indicate that it doesn't work consistently.
Therefore, since I understand you don't specifically require using Expo (you just say "ideally in Expo" :), you can try following this React Native tutorial (June 2021): React Native background location (background & terminated app) (it uses react-native-location library).
It seems that this could be exactly what you're looking for:
React Native — Background Location Tracking without Timeout and with App killed
https://itnext.io/react-native-background-location-tracking-without-timeout-and-with-app-killed-3dbfbc80ad01
Related
The truth is, since nuxt works poorly in some native access, such as accessing the file manager or sending notifications to iPhone users, I am not sure if appstore supports nuxt projects or not. That's why before I start the new project, I had a question whether it is possible to put a nuxt project in appstore or not? (If the answer is yes, please guide how to do it)
Or using something like react or react native is a better option ?
Any answer from you would be greatly appreciated
As per Apple’s App Store policy-
“Your app should include features, content, and UI that elevate it beyond a repackaged website. If your app is not particularly useful, unique, or “app-like,” it does not belong on the App Store.”
So no, you can’t throw a PWA in the App Store.
Google is far more accommodating in this respect, and welcomes PWAs in the Google Play Store. They also have their own publishing guidelines, so you’d want to read up on them.
React Native is an option for both the App Store and Play Store, so I’d recommend that if you’re comfortable with it.
First off, Nuxt is a meta-framework of Vue.
Meaning that it is a superset of Vue, bringing SSR/SSG capabilities + DX features.
It's clearly not a "mobile app-frienly starter" because it's still aimed towards Web.
You could use some modules to bring mobile capabilities like this one: https://ionic.roe.dev/
Here is a video on how to use Ionic + Vue + Vite overall: https://youtu.be/-FwQ6c6OreQ
As for the PWA approach, you can use a TWA app for sure but it's quite a stretch as you can guess.
You've already asked a similar question here btw, not a lot changed since then.
Overall, if you have bigger mobile needs you can always look into webview tools (Ionic, Cordova etc), React Native, Flutter or directly into Kotlin/Swift. All of them having their own pro/cons.
In all the react-native tutorials I have seen so far, on building a chat app, I see them using gifted chat.
After installing the library, it is really buggy and slow. Below are some things I experience when using it.
When I have messages over 100, it takes time to load my chats.
When I press the send button, It takes time as well before updating the chat list(about a second).
Are there any other alternatives to gifted chat?
Slowness or fastness would depend on the "backend" (database and/or server) you are integrating your chat app (or component) with. Firebase (from Google) FireStore or Firebase Realtime DB would be one of the best options to choose from. This might help you in integrating Firebase DB with gifted-chat.
react-native-gifted-chat seem not to be actively maintained.
I found react-chat-elements I did not try it yet.
If you found something else please leave a comment.
good look with your search.
I need to develop an app using React Native which will get some data from Amazfit Stratos smart watch.
The smart watch is connected to the phone via bluetooth and has an application "Amazfit" where it actually gets the data that I need (i.e. step count, heart rate, etc.). After a lot of research (google and youtube), I have not encountered a way to import the data into my application. Since I haven't started making the application, there is no code to show. Can any one provide any basic solution to this problem?
My guess is (if it's possible):
Make my application communicate with the smart watch
Make my application communicate with Amazfit Android application
Any help greatly appreciated!
I want to make an application which will send information to a server about user's location every 30min. It is needed to provide location specific push notifications.
I need such functionality for Android/iOS, which would work in background (also if device is restarted). I found some articles covering background services and I created background service doing that, but after phone is restarted it won't work.
Is it possible with Android and iOS? How can I achieve that?
With iOS, no. With Android, yes.
Apple has gone to great lengths to limit what apps can do. You can do some things in the background for an extended period of time (GPS, play audio, Voip, etc), but after a reboot your app will not be restarted until the user opens it again. There are exceptions to this. Voip apps are allowed to restart after a reboot, but apple will not approve your app for the App Store unless you actually have a place for a user in your app to use the Voip feature. Geofences are a possibility, but I haven't had experience with that feature yet. In my experience, Apple does whatever they can to make sure your app doesn't run forever.
With android, there is more flexibility and what you propose is totally possible. I've listed some important links below, since most of those solutions are far better documented than what I can do here.
Essentially you need to register as a boot receiver and then send an intent to start a titanium android service when the boot event is received. I don't have experience with starting a titanium service, but I'm sure its a simple intent you need to fire. Either way you'll need a module for this native code. I attached a link to a bencoding titanium module that may help you, although there may be some others out there. You may even need to code one yourself.
Samsung is notorious for stopping your app with their SPCM feature. You may want to familiarize yourself with it. I've added a stackoverflow discussion link below.
I don't know all of your system requirements but honestly, for any app I would try my best to not run forever. It will hurt the battery life for your users and will add a lot of complexity. Maybe you could simply have the app check the GPS coordinates when it receives a push notification and decide right there and then whether to present a notification to the user? Just something to consider.
Either way good luck!
How to start an Application on startup?
http://docs.appcelerator.com/platform/latest/#!/guide/Android_Services
https://github.com/benbahrenburg/benCoding.Android.Tools
Dealing with Samsung SPCM killer
I am to looking for a quick way to implement a dynamic location based filtering of points of interest feature in an iOS App - where a user's location continuously changes and as a result the points of interest will continuously change.
I see that firebase geofire has a similar feature but written in .js. Can you advise if this can be leveraged in an iOS App with no webviews?
GeoFire now has an Objective-C library!