Skip to end of metadata
Go to start of metadata

The notification service allows you to send notifications to the user, which will usually be shown in the notifications bar.

Showing Simple Notification

To quickly show a notification, you can issue a local notification as follows.

On this page:

Customizing Notification Behaviors

The LocalNotification Class object allows for extensive customization of the notification. Please take a look at the following code:

The HasAction property indicates that the user will be redirected to the app if the notification is clicked. You can also specify the RepeatInterval property to schedule notification on a timely basis. ScheduledDate specifies when the notification should be issued for the first time. You can also put specific user informations to be retrieved later when the application is started by providing a Dictionary<string, object>() which will be then invoked later when the application’s Navigated event is triggered.

Cancelling Notifications

To cancel a notification, you can use the Guid of the notification and then cancel it.

It is recommended that you keep a reference of the notification Guid for cancelling in the future, given that the notification is a recurring notification.

Cancel All Notifications

To cancel all notifications, you can use the following method.

Notification Settings in iOS

Specifically on the iOS platform, an additional setting is required in the application-level code to enable the notification to work properly. In the AppDelegate class of your iOS project, you need to register the UserNotificationSettings to the application object such as shown below.



Check out the entire mobile services in action with this sample: Services Samples.