Home > DeveloperSection > Forums > Windows Phone 7 Reminders
Samuel Fernandes
Samuel Fernandes

Total Post:156

Points:1096
Posted on    April-07-2015 7:50 AM

 .NET Windows Phone 
Ratings:


 1 Reply(s)
 545  View(s)
Rate this:
How strict/loose are Microsoft on approving Windows Phone apps submitted to the marketplace? I know there are tonnes of stories of developers having their iphone apps rejected on unreasonable grounds, and I know Google let you publish just about anything to the Android market...how are your experiences with WM platform?


Mayank Tripathi
Mayank Tripathi

Total Post:397

Points:3117
Supported
Posted on    April-07-2015 8:04 AM

Since the reminder needs a DateTime its pretty easy. Each application has a max of 50 reminders:

DateTime dateTime = DateTime.Now; //First Friday at 10am
for (int i = 0; i < 50; i++)
{
    Reminder reminder = new Reminder("MyReminder")
    reminder.Content = "Reminder";
    reminder.BeginTime = dateTime.AddDays(i * 7);

    ScheduledActionService.Add(reminder);
}

-or this may work-

Reminder reminder = new Reminder("MyReminder")
reminder.Content = "Reminder";
reminder.BeginTime = DateTime.Now; //First Friday at 10am
reminder.Content = "Reminder";
reminder.ExpirationTime = DateTime.Now.AddDays(52 * 7);
reminder.RecurrenceType = RecurrenceInterval.Weekly; 

ScheduledActionService.Add(reminder);

EDIT

This is how you get the next day of week

private DateTime GetNextDay(string dayOfWeek)
{
    for (int i = 0; i < 7; i++)
    {
        DateTime currentDateTime = DateTime.Now.AddDays(i);
        if (dayOfWeek.Equals(currentDateTime.ToString("dddd")))
            return currentDateTime;
    }

    return DateTime.Now;
}

Don't want to miss updates? Please click the below button!

Follow MindStick