i never tried to add/edit event the calendar. but from the documentation(What's New in iOS4), it is clear that we can add/edit event in calendar programmatically. So i just want to ask how can we get all event of particular day ? Basically i want to validate the time of all event for particular day.
Related
I'm working on an ionic project.
If users don't open the application for a long time after downloading my app, I'd like to send them local notification.
For example, I will send a notification if it does not open for 3 days. But I couldn't figure out how.
Can you help me?
You can use the following to send notifications from server:
Create one table in your database to track user activities.
Add columns as userId, lastActivity to store the time of the user's activity.
Update the lastActivity column whenever the user opens the app.
Write one scheduler which will run at a specific time every day.
In the scheduler write a logic to get data from UserActivity table and compare the time stored in the table with your current time.
If the time difference is greater than 3 days then send a notification to that user.
For local notifications here is a way:
Whenever user open's the app schedule the local notification of after 3 days from current date. ( Make sure to remove previously schedule notification before adding new one. )
In this case if user open the app notification will reschedule automatically else notification will fire based on last schedule of it.
You can create a system in which you track user like ,
if user's opens your App then you must update true value for that user with time in your database and now you can compare current time with user's time value and if its more then 3 days you must send notification to that user.
Looks like there is a bit of inconsistency between 2 ways calendar RECURRING events could be created using the TIME ZONE:
'quickAdd' - does not require you to provide a timezone. The Calendar's default (UTC) or the one set by the Calendar owner will be used. Fair enough.
'insert' - the API doc states: "For recurring events this field is required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for the event start/end."
Why for 'insert'-ing recurring events we cannot use use the time zone the Calendar already have?
The 'quickAdd' api endpoint clearly shows that it is possible!
For example, if you call the quickAdd with the following text (Important meeting at Office at 11am-11:25am every Fri with John) recurring events will be created with the time zone that already set in the Calendar!
Sure thing that I could get the Calendar time zone from the settings (/calendar/v3/users/me/settings/timezone). But this will require one extra call. It will cause more latency and bring more complexity to the code.
Another issue. The quickAdd api call for recurring events creates not only recurring events but also the same event on the day when the call been made! The API doc does not provide any explanation what are the correct values for the text attribute.
Would be great to hear back from Google API team to clarify those things.
Thank you.
I have calendar events in my java web project,
in which i want to send reminder before some time (time can be minutes/hours/second depends on selection while creating event),
How can i send mails before those particular time?
I am making a reminder app, if there aren't a million out there.
I let the user specify a time to remind him of a to-do task.
So lets say the user specifies that he needs to be reminded at 9:00am every Monday.
When he closes the app and its goes in the background I create a UILocalNotification fire time.
at 9:00am on next Monday the user gets the notification.
If he launches my app and adds another reminder for some other day/time (not important) and closes my app by clicking on the home button then he gets a notification right away.
This is because the first notification was set to past Monday date
How can I avoid this yet still deliver a notification next monday?
I found this by googling
"If you specify a date that is in the past (or nil) the notification is delivered immediately. "
So, here's what I got from your question:
User makes repeating event for 9:00AM every Monday
You schedule a single local notification for the next occurring Monday at 9:00AM
One Monday at 9:00AM occurs; the users's event fires
User makes another arbitrary event
The users's first event fires, as if it was Monday at 9:00AM, presumably because Monday at 9:00AM has already happened once
In order to resolve this, you want to make sure you're doing both of these things:
Make sure you're releasing the UILocalNotification.
//Manual Memory Management
[yourLocalNotif release];
//Automatic Reference Counting
yourLocalNotif = nil;
Make sure rescheduling your repeating events for the next occurring time.
If this isn't quite what you're looking for, post some code and I'll try and reevaluate :)
In my application, the user chooses a day (monday-sunday) to set an alarm for and the application sets up a local notification to repeat weekly on this day. How can i get my application to create a looping weekly notification for this day of the week every week?
Use EventKit to create a recurring event.