Creating event reminders - ionic-framework

I am working on an ionic project. It is based on medication managing.And I want to remind the user about their medications. I am new to this and can some one give me a sample code, link or something to create reminders.

I would recommend taking a look at Local Notifications, they are notifications that can be scheduled on the device without the need for a server. It is commonly used for things like reminders. You can also choose to do this using a server with Push Notifications, but that doesn't seem necessary in your situation.
For starters, take a look at the documentation for Local Notifications, see if it works for your use case.

Related

Flutter app: simple way to remember a user to do something

I have a cool flutter app which is used to track staff attendance. A user can check-in and check out when they start/stop working and the app record that event, calculate the number of hours worked and send a weekly summary to the manager of the staff expected wages. The current problem is that some staff members forget to check out (everyone is ok with check-in) so we don’t have good numbers and we need to manually change the attendance. I would like to add something to remember them to check out, and I am looking for creative ideas to do so. My objective is to make something very affordable.
So far I thought about two options:
to use geolocation and track when staff get in/out of a certain location and log it as check-in and check out
to set a timer when they start the shift and send a local notification if after xx hours they have not done the checkout
Geolocation seems to be the best because I can even automate the checkin/check out and do it in the backend but it will consme lots of resources in the client because I would need to check their location every while even when their at at home or on holiday...
The timer has some limits and still, I would need to manage background tasks that are complex as well as imprecise checkout depengin on when the notification goes out.
Do you have any suggestions on anything simple to implement?
I would suggest the second option.
A simple scheduler which would look for all the employees who are checked in for more than x number of hours and then throw a clickable notification to checkout. It would be an easy and clean solution. However, it has several limitations as an employee might leave early but checkout later.
In my opinion, Your most clean solution would be to have an RFID/NFC check which automatically registers as a user checks out from the building.
Another thing that can be done if your employees are working mostly on their computers. There can be a browser extension or a web app which will clock in the time they are working on their laptops. Once they close it they will be automatically checked out.

How to send push notification when data changes from API

I'm currently creating an iOS application in Swift that fetches data from a third party API and then displaying it on the screen.
One of the features includes enabling push notification so that the user gets a push notification if there's a change in the API data.
However, I'm struggling to figure out how to implement the push notification side of it so that I can constantly monitor the API data and then send out a push notification when there's a change in the data.
Can someone point me in the right direction on how to do this? I've previously used Firebase to implement push notifications but the push was triggered from a user action. I was wondering whether there's something similar I can utilise in Firebase or if there's any other recommendations?
Thank you!
You may be able to use cloud functions. If you're monitoring the data client side you can perhaps make a call to a cloud function to send a push notification.
Or you may want to look into local notifications. I'm not sure exactly what you're trying to accomplish so it's tough to really say, but as far as a direction goes I would recommend checking out cloud functions and local notifications to see if either one solves your needs.
Edit:
Now that I know more what you're looking for I would check out this article here. It will explain about Background App Refresh. Here's an excerpt from the article.
When the system calls your app delegate’s application(_:performFetchWithCompletionHandler:) method, configure a URLSession object to download any new data. The system waits until network and power conditions are good, so you should be able to retrieve adequate amounts of data quickly. When you finish updating your app, call the completion handler and provide an accurate result of your outcome, which can include saying that no new data was available.
So in the application(_:performFetchWithCompletionHandler:) method you would want to:
Download the new data
Compare it to old data and see if there's been a change
And then probably I would just display a Local Notification to the user.
I think that would be the easiest way with your current architecture and without having to write any server side code.

Firebase notifications Swift

Yes I know that this has been asked on StackOverflow before but I just can't find exactly what I am looking for. So what I would like is when a user (user1) send a message to another user (user2) , for user2 to get a notification saying they have a new message from user1. So far I have set my app up so that I can send a push notification from the Firebase Console, but not so that the app does it automatically. I think I need an observe function but I am not quite sure what to do or the code for it?
Thank you so much for all the help! This is my first time with Firebase.
You can just use Cloud Functions.
It simply triggers a Function when an Event occurs.
For example whenever a new message added to a node you can run a function that sends a Notification to the user
Check the Documentation
Also check this sample which matches what you need
I have asked same question some time ago. The thing that was bothering me was why should I use Cloud Functions and write and deploy functions for it in javascript if I just wanted to send Notifications just between two users?
So I checked out other options and setup everything in just about few minutes without writing any javascript functions in the Firebase Cloud Functions.
Well it depends on what you will exactly need but in my case using Cloud Functions just to handle that was nonsense. If you are in the same situation as I was you can use OneSignal like I did. There is also my question on this and you can check it out here.
you can try this it can worked for me sending notification through fire base cloud
https://github.com/firebase/quickstart-ios
https://github.com/firebase/quickstart-ios/issues/286#issuecomment-304992090

Prevent google calendar from creating duplicate entries when a remote icalendar file changes

There's a lot of events happening all the time on my university campus, and, together with a few other students, we thought it would be nice to provide the event schedule as a calendar. So organisers register their event on the intranet, and it gets added to an icalendar file which people on the campus can subscribe to.
This works great when people load the calendar url on their iPhones, but it doesn't when loading in Google Calendar. We have noticed two problems:
When you subscribe to the calendar and then log out and back in, events are no longer visible. Sometimes, clicking refresh fixes it. The vents do not disappear from android devices associated with your account.
When an event is removed from the icalendar file (eg. if it's cancelled), it still remains on the android devices that sync with any google account that subscribed to the calendar. New events sync fine, though, so it's not that the sync didn't happen.
Do you know how I can solve these two problems? I've noticed the STATUS:CANCELLED property in VEVENTs, but it doesn't seem to work when the calendar method is PUBLISH.
Thanks!
PS: If you can suggest a way to test changes faster that waiting for Google to pull the changes from the server, it would be great; right now, I have to wait about 6 hours between each test...
my understanding is that removing it from the file is not the way to cancel an event. One must ensure that there is a UNIQUE identifier to match any changes.
Also must follow the spec for cancelling/changing an event.
See How to cancel an calendar event using ics files?
If all of that is correct, then the various applications that 'subscribe' to a calendar should in theory update the event status when they read the updated file. Unfortunately the speed and frequency of that is up to that application. (NB: note also difference between subscribe and "import")
Yes I have noticed that google is slow to update sometimes. Only thing I can think of is use another application where you have control perhaps over the subscription update frequency to test if the way that you are cancelling an event is working. Once you see the cancellations happening there, then resume testing on google (I have noticed Google is more pedantic than some apps, so you may still have to work to get it 100% working on google.)
Hope that helps!
I've tried the suggestions but Google Calendar only ever adds another event. The iCalendar validators say that the files I generate are valid, and iCal on the Mac removes an event if it has cancel information. But neither Google Calendar or Outlook do. Rather frustrating.

APNS provider that parses data to send

I would like to create a service that parses data from a feed and then sends notifications to subscribed units.
And I'm note sure how to approach this problem. Would be thankful for any advice.
If you're going to be sending less than 1,000,000 push messages per month (greater than that amount you would have to pay), I'd look into UrbanAirship . They have something called a feed feature that does this:
Urban Airship has a feature where we
will monitor an RSS or Atom feed and
send a push notification when a new
entry is published. We allow you to
set up a template to extract items
from the feed to dynamically generate
push notifications with content from
the new entry. You can easily set this
up from the interface at
https://go.urbanairship.com/ , but
this API allows you to
programmatically create them.
So, that might work for you. Or, you can look into setting up your own server that runs a script, parsing your feeds. Then you can use Easy APNs to send the messages yourself. I'm using it and it works perfectly for my needs. For me the learning cure was steep because I'd never done anything besides Obj-C, but it ended up being quite easy to learn.