Local notifications & background tasks


#1

Good afternoon folks, hope you’re all having a great weekend!

I’m expecting the answer to this to be “It’s not possible yet”, but I figured it was worth asking. Within my app, I’m retrieving train timetable data from an API periodically. I don’t have access to the API server itself as it’s a third party service. I also don’t have a wish to set up my own server because even though I can, that’s extra work setting up an accounts system for an app which doesn’t even have or need a login function.

What I’m trying to do is send local notifications upon certain events. For example, if a train is running late, I want to send a notification to the local device to let the user know this. I know that I can use the notifications API provided by Expo but if I understand correctly, this can only work while the app is open in the foreground - still useful to have if you’re implementing navigation with many screens, but it could be more useful with background support. With background tasks/services still not supported, is there any alternative or workaround that would work?

I’m not looking to detach at the moment as I don’t know how to use Android studio to even build a working APK (the guide is kind of confusing about this - saying ‘just use the detached project source code’ isn’t a huge help for someone with no experience using Android studio), and this feature isn’t major enough to warrant the extra work.

Alternatively, if someone can provide some extra guidance on exactly what I need to do (and which folders are relevant) once I open up Android studio after detaching to get a built, runnable APK, I should be able to figure things out from there. I’ve seen guides on adding background tasks to a react-native app, but I’m just completely clueless on the actual build-step from Android studio.


closed #2

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.