The following question: In React-Native via the library react-native-background-fetch it is possible to execute a task in the background. For example to send a push notification. I looked at the following example in the course: https://medium.com/#alihaghani/background-tasks-and-local-push-notifications-with-react-native-d63fc7fff9b
Now in the documentation of "react-native-background-fetch" it is written that it is not possible to run a task under 15 minutes interval. Does anyone know how I can still run a task for example every minute or every 2 minutes?
If not, does anyone have a solution for the following problem:
(minimal example) I have an app that searches for Bluetooth connections in your area. When a signal is found, then show a push notification. Every minute it searches for a signal. This should happen in the background of course. For this it should be checked under 15 minutes.
Is this somehow possible with react-native?
I have already built an app that displays push notifications. I have implemented this with Firebase. In my opinion, Firebase will not be able to help me here, because the push notification is only sent when a certain logic applies, right?
Thanks to anyone who can give me some thought or even a solution to the problem
Related
Hello I am trying to build a webapp using pwa.
I am trying to set an alarm by giving an app push at a time set by the user.
I have a few questions, and I would be very grateful if you could tell me how to implement it as well. (Even if it is not a method, I would be very grateful if you could tell me if it is possible!)
Can I make a push alarm go off at a user-specified time with pwa?
Can you make it vibrate and sound after the push alarm goes off until the user wakes up and presses Badge?
Can I make the push alarm go off every 5 minutes (a specific time)?
I am a beginner doing a toy project. I'm not good at development, so I'm asking a question.
I really appreciate it if you can help me :)
have a good day!
PS If the above functions are not possible with pwa, I am trying to implement it using react native, but is swift or kotlin used a lot?
I am working on a react-native based mobile app using expo.
in the app the user can set schedules for medication reminders, for that I am using expo-notifications to show those reminders.
expo-notifications provides some functions to schedule notifications, but as I found in the docs it does not provide scheduling options that I need, like every Sunday at 09:00am, or every 2 days at 05:00pm, daily at 08:30pm, and so on...
How can I achieve such scheduling?
expo-notifications author here! 👋
It depends on your use case, but I would suggest either:
use push notifications sent from your backend, where you can design any schedule you like (disadvantage would be that an offline device wouldn't receive the notification and that you'd have to write and maintain that backend)
try to work around the limitations
every Sunday at X soon will be achievable with WeeklyTrigger
every 2 days is tricky, maybe an interval trigger with some offset (not possible right now, but I'll happily review a pull request if you submit one)
daily at X is already supported with DailyTrigger
submit a pull request adding missing trigger types or adding features to existing ones.
I need a bit of guidance, so for my application i'm looking at using local notifications to send a notification every morning at 7 o'clock.
The issue i'm having is how can i make the content for the local notification dynamic mainly the body and the attached image? As it will vary for the user on a daily basis.
What would be the best way to go about this since you can't edit future notifications.
Here's a little lesson about notifications. First, what is a notification? It's basically an alert presented on your behalf by the system. Second, there are two kinds of notification: local and remote.
Let's imagine, then, an app that aims to present a notification to the user every morning at 7 AM saying what the current temperature is outside. (Assume for purposes of the example that we have a way of learning this information.)
A moment's thought will reveal that this cannot be done with local notifications. We cannot know the current temperature at 7 AM until 7 AM (or close to it) and we cannot schedule the notification unless the app is running. Therefore we would need the great good luck to have the app running at 6:59 AM in order for this app to work. But an app only runs when the user summons it, so that is extremely unlikely.
Therefore a task of this kind is possible only with remote notifications. A remote server is always running; therefore it can get the temperature and "ping" the user's device at 7 AM, and the system will present the notification on your behalf. You would therefore need to possess such a server in order to write the imagined app.
(An alternative using local notifications would be this: You schedule, say, a week's worth of local notification in advance. Then if you have the great good luck to find the app running before a notification is presented, you tear down all the scheduled notifications and do it again with a more up-to-date forecast. But of course this cannot possibly work as well as using remote notifications, and it will stop working entirely after a week if the user doesn't launch the app. That, to put it bluntly, sounds pretty lame.)
I'm newbe to watch os 2, so don't really know where to start with this.
Is it possible to write a WatchOs 2 app, that will run in background and will wake up once an hour?
There is not that much info available on the web, but what I've seen so far suggests that it's not possible to write background apps. Still, I'm wondering, how do you write an app that acts like an alarm clock and wakes up at specific times during the day?
The simple WatchKit Apps can't run in background without user permission. In order to have you app running in the background, you must implement a Workout-style app, but instead of getting health and activity data, you can implement an alarm clock app, or something similar.
You can learn more on developer.apple.com documentations by clicking on the link above.
How can an application perform stuff when its actually closed like google+?
I notice that I got a notification from huddle chat from the google+ app for iOS. But google+ was actually not active, it was closed. Same situation with Whatsapp, I always get push messages both if the app is closed or active.
This kind of behaviour seems for me to be impossible to implement. From other questions I know that we cannot register some kind of background process. How do this apps handle that?
Can I still listen form something when my app is minimized?
When my app is just minimized but not closed I know that a certain method is called. Can I perform a repeating update task, e.g. read geo data?
The apps you mentioned use something called Push Notifications which work regardless of your App being open/in the background/closed. They are notifications sent to the device when an action happens and most of the processing is done on the Server (The notifications are not generated by the App itself. A server pushes the Notification on).
Apple has a fantastic section on Executing Code in the Background when your App is minimised which should provide most of the answers you need. It even has a dedicated section on explaining the Geo Data capture which should help you in this case.