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.
@UmarCloud on Twitter #gamingumar http://facebook.com/whilegeek
Here we are going to create a Windows Phone 8.1 Project.
- Open your project, Right Click on your Solution in Solution Explorer and click Add new Project.
- 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.
- 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
- Create your Background task and call your toast notification function from it.
- Install NotificationsExtension.WinRT library from NUGet Package Manager and create toast notification using it.
Your Run function should look like this |
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