Defines the content, associated metadata, and expiration time of an update to a tile's badge overlay. A badge can display a number from 1 to 999 (beyond this truncation will occur)
PlatformVersion supported iOSiOS 9.0 and later macOSOS X 10.7 and later tvOStvOS 9.0 and later TizenTizen 3.0 Windows UWPWindows 10 Windows StoreWindows 8.1 or later Windows Phone StoreWindows Phone 8.1 or later Windows Phone SilverlightWindows Phone 8.1 or later
Ejemplo n.º 1
0
        /// <summary>
        /// Applies a change to the badge's number.
        /// </summary>
        /// <param name="notification">The object that supplies the new XML definition for the badge.</param>
        public void Update(BadgeNotification notification)
        {
#if __MAC__
            if (notification.Glyph != char.MinValue)
            {
                NSApplication.SharedApplication.DockTile.BadgeLabel = notification.Glyph.ToString();
            }
            else
            {
                if (notification.Value < 1)
                {
                    Clear();
                    return;
                }

                NSApplication.SharedApplication.DockTile.BadgeLabel = notification.Value.ToString();
            }
#elif __UNIFIED__
            UpdateImpl(notification);
#elif TIZEN
            //Tizen.Applications.Update(Tizen.Applications.Application.Current.ApplicationInfo.ApplicationId, (int)notification.Value);
#elif WINDOWS_UWP || WINDOWS_APP || WINDOWS_PHONE_APP || WINDOWS_PHONE_81
            _updater.Update(notification);
#endif
        }
Ejemplo n.º 2
0
 private void UpdateImpl(BadgeNotification notification)
 {
     if (s_granted)
     {
         var request = UNNotificationRequest.FromIdentifier(Guid.NewGuid().ToString(), notification._content, null);
         UNUserNotificationCenter.Current.AddNotificationRequest(request, AddCompleted);
     }
 }