Thursday, 16 October 2014

Creating a Reminder in Windows Phone 8.1 C#

Reminder and Alarm APIs are no longer exposed for Windows Phone 8.1, as it was previously available for Windows Phone 8, so this makes lots of people confused about how to create a reminder without these APIs. So to create reminder what you can do is to create a Time Triggered Toast notification.
Here we are going to create a Windows Phone 8.1 Project.

  1. Open your project, Right Click on your Solution in Solution Explorer and click Add new Project.
  2. Select Windows Runtime Component. This Windows Runtime component is actually going to be our Background Process that will run in the background of Windows Phone or PC, so that user can get notifications on specified date and time.  
  3. Add new Class in your Background Project, we are going to call it Reminder, make it public and inherit it from IBackgroundTask interface.
    • Resolve it using Windows.ApplicationModel.Background
    • Right Click on Interface and Implement it. 
    • This will add a Run function that is where you have to add your background code, that you want to run
  4. Create your Background task and call your toast notification function from it.
  5. Your Run function should look like this
  6. Install NotificationsExtension.WinRT library from NUGet Package Manager and create toast notification using it.
Detail Procedure of creating Background Task and Toast Notifications with different options will be on further blog posts.







@UmarCloud on Twitter #gamingumar http://facebook.com/whilegeek

No comments:

Post a Comment