private Bundle NotificationToBundle(XamarinFormsPushDemo.HMSPush.Model.LocalNotification notification) { Bundle bundle = new Bundle(); bundle.PutString(NotifyConstants.Title, notification.Title); bundle.PutString(NotifyConstants.Message, notification.Message); bundle.AddString(NotifyConstants.Importance, notification.Attributes); bundle.AddString(NotifyConstants.Priority, notification.Attributes); bundle.AddString(NotifyConstants.Visibility, notification.Attributes); bundle.AddString(NotifyConstants.BigText, notification.Attributes); bundle.AddString(NotifyConstants.SubText, notification.Attributes); bundle.AddString(NotifyConstants.Tag, notification.Attributes); bundle.AddString(NotifyConstants.Ticker, notification.Attributes); bundle.AddString(NotifyConstants.ChannelId, notification.Attributes); bundle.AddString(NotifyConstants.ChannelName, notification.Attributes); bundle.AddString(NotifyConstants.ChannelDescription, notification.Attributes); bundle.AddString(NotifyConstants.RepeatInterval, notification.Attributes); bundle.AddString(NotifyConstants.SoundName, notification.Attributes); bundle.AddString(NotifyConstants.Color, notification.Attributes); bundle.AddString(NotifyConstants.Group, notification.Attributes); bundle.AddString(NotifyConstants.LargeIconUrl, notification.Attributes); bundle.AddString(NotifyConstants.Number, notification.Attributes); bundle.AddString(NotifyConstants.BigPictureUrl, notification.Attributes); bundle.AddString(NotifyConstants.RepeatType, notification.Attributes); bundle.AddStringArray(NotifyConstants.Actions, notification.Attributes); bundle.AddInt(NotifyConstants.Id, notification.Attributes); bundle.AddInt(NotifyConstants.LargeIcon, notification.Attributes); bundle.AddDouble(NotifyConstants.VibrateDuration, notification.Attributes); bundle.AddLong(NotifyConstants.RepeatTime, notification.Attributes); bundle.AddLong(NotifyConstants.FireDate, notification.Attributes); bundle.AddBool(NotifyConstants.Vibrate, notification.Attributes); bundle.AddBool(NotifyConstants.Ongoing, notification.Attributes); bundle.AddBool(NotifyConstants.PlaySound, notification.Attributes); bundle.AddBool(NotifyConstants.AllowWhileIdle, notification.Attributes); bundle.AddBool(NotifyConstants.InvokeApp, notification.Attributes); bundle.AddBool(NotifyConstants.DontNotifyInForeground, notification.Attributes); bundle.AddBool(NotifyConstants.AutoCancel, notification.Attributes); bundle.AddBool(NotifyConstants.GroupSummary, notification.Attributes); bundle.AddBool(NotifyConstants.OnlyAlertOnce, notification.Attributes); bundle.AddBool(NotifyConstants.ShowWhen, notification.Attributes); bundle.PutInt(NotifyConstants.SmallIcon, Resource.Mipmap.HWIcon); return(bundle); }
public void LocalNotificationSchedule(XamarinFormsPushDemo.HMSPush.Model.LocalNotification notification) { NotificationController.LocalNotificationSchedule(Application.Context, NotificationToBundle(notification)); }
public async Task LocalNotificationNow(XamarinFormsPushDemo.HMSPush.Model.LocalNotification notification) { await NotificationController.LocalNotificationNow(Application.Context, NotificationToBundle(notification)); }
public void InvokeApp(XamarinFormsPushDemo.HMSPush.Model.LocalNotification notification) { NotificationController.InvokeApp(Application.Context, NotificationToBundle(notification)); }