public override void HandleIntent(Intent intent)
        {
            try
            {
                //if (intent.Extras != null && intent.Extras.Get("your_data_key") != null)
                //{
                //    string strNotificaiton = intent.Extras.Get("your_data_key").ToString();
                //}

                if (intent.Extras != null)
                {
                    var builder = new RemoteMessage.Builder("MyFirebaseMessagingService");

                    foreach (string key in intent.Extras.KeySet())
                    {
                        builder.AddData(key, intent.Extras.Get(key).ToString());
                    }

                    OnMessageReceived(builder.Build());
                }
                else
                {
                    base.HandleIntent(intent);
                }
            }
            catch (System.Exception ex)
            {
                Log.Debug("MyFireMessagingService", "From: " + ex.StackTrace);

                base.HandleIntent(intent);
            }
        }
Exemplo n.º 2
0
        public override void HandleIntent(Intent intent)
        {
            try
            {
                if (intent.Extras != null)
                {
                    var builder = new RemoteMessage.Builder("MyFirebaseMessagingService");

                    foreach (string key in intent.Extras.KeySet())
                    {
                        builder.AddData(key, intent.Extras.Get(key).ToString());
                    }

                    this.OnMessageReceived(builder.Build());
                }
                else
                {
                    base.HandleIntent(intent);
                }
            }
            catch (Exception)
            {
                base.HandleIntent(intent);
            }
            Console.WriteLine("Handle Intent @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
        }
        public override void HandleIntent(Intent intent)
        {
            try
            {
                Log.Debug(TAG, "Handling notification intent");
                if (intent.Extras != null)
                {
                    var builder = new RemoteMessage.Builder("MessagingService");

                    foreach (string key in intent.Extras.KeySet())
                    {
                        builder.AddData(key, intent.Extras.Get(key).ToString());
                        Log.Debug(TAG, $"{key} : {intent.Extras.Get(key).ToString()}");
                    }
                    OnMessageReceived(builder.Build());
                }
                else
                {
                    base.HandleIntent(intent);
                }
            }
            catch (Exception ex)
            {
                Log.Error(TAG, ex.StackTrace);
                base.HandleIntent(intent);
            }
        }