Customizing wearable notifications
Notifications displayed on the wearable offer a hands-free experience for using apps; however, it is often desirable to provide the user with a wearable-specific experience.
How to do it...
Notifications from a handheld device can be easily displayed on wearables, but we can also provide special features for notifications that will only appear on a wearable:
- We can customize the appearance of notifications using extenders, such as
NotificationCompat.WearableExtender
for wearable devices:var background = BitmapFactory.DecodeResource( Resources, Resource.Drawable.notificationBackground); var extender = new NotificationCompat.WearableExtender() .SetHintHideIcon(true) .SetBackground(background);
- We can also use extenders to provide specific action buttons for the wearable, instead of just using the actions from a handheld:
var icon = Android.Resource.Drawable.IcDialogDialer; var action = new NotificationCompat.Action( icon, "Make Call", pendingIntent...