Пример #1
0
        public override void OnNotificationPosted(StatusBarNotification sbn)
        {
            lastPostedNotification = sbn;
            catcherHelper.OnNotificationPosted(new OpenNotification(sbn));

            //var test1 = sbn.Notification.Extras.GetString(Notification.ExtraTemplate);
            //var test2 = sbn.Notification.Extras;
            //var test3 = sbn.Notification.Flags;
            //var test4 = sbn.Notification.Extras.GetCharSequence(Notification.ExtraSummaryText);
            //var test5 = sbn.Notification.Extras.GetCharSequenceArray(Notification.ExtraTextLines);
            //var test6 = sbn.Notification.Extras.Get("android.wearable.EXTENSIONS");
            //var test7 = sbn.Notification.Extras.KeySet();
            //var test8 = sbn.Notification.Extras.Get("android.people.list");
            //var test10 = sbn.Notification.Extras.Get("android.messagingUser");
            //var test11 = sbn.Notification.Extras.Get("android.messagingStyleUser");
            //var test12 = sbn.Notification.Extras.Get("android.messages");
            //var test13 = sbn.Notification.Extras.GetParcelableArray("android.messages");
            //var test15 = (NotificationPriority)sbn.Notification.Priority;
            //foreach (Bundle item in test13)
            //{
            //    var test14 = item.KeySet();
            //    var moreExtras = item.Get("extras");
            //    var sender_person = item.Get("sender_person");
            //    var sender = item.Get("sender");
            //    var text = item.Get("text");
            //    var time = item.Get("time");
            //}
        }
Пример #2
0
        public override void OnNotificationPosted(StatusBarNotification sbn)
        {
            if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
            {
                //Let's attach the NotificationChannels that this package represents to this StatusbarNotification
                try
                {
                    var channels = GetNotificationChannels(sbn.PackageName, sbn.User);
                }
                catch (Exception ex)
                {
                    Log.Info("LiveDisplay", "Oops!: " + ex.Message);
                }
            }
            catcherHelper.OnNotificationPosted(sbn);

            //var test6 = sbn.Notification.Extras.Get(Notification.ExtraMediaSession) as MediaSession.Token;

            //if (test6 != null)
            //{
            //    try
            //    {
            //        MediaController mediaController = new MediaController(this, test6);

            //        var musicController = MusicController.GetInstance();
            //        mediaController.RegisterCallback(musicController);
            //        //Retrieve the controls to control the media, duh.
            //        musicController.TransportControls = mediaController.GetTransportControls();
            //        musicController.MediaMetadata = mediaController.Metadata;
            //        musicController.PlaybackState = mediaController.PlaybackState;
            //    }
            //    catch
            //    {
            //        //mediaController?.UnregisterCallback(musicController);
            //        //musicController.Dispose();
            //    }


            //    //mediaController.RegisterCallback(MusicController.GetInstance());
            //}
        }
Пример #3
0
 public override void OnNotificationPosted(StatusBarNotification sbn)
 {
     catcherHelper.OnNotificationPosted(sbn);
 }