Intent is null, when android app is minimized or closed.

Tanim3kTanim3k Member
edited August 2018 in Xamarin.Forms

I am getting intent extras null when application is minimized or closed. I am also using splash activity,

Project Info:
Prism.Unity.Forms 7.0.0.396
Xamarin.Forms 3.1.0.697729
Xamarin.Firebase.Messaging 32.961.0

protected override void OnCreate(Bundle bundle)
{
...............

        if (Intent.Extras != null)
        {
            foreach (var key in Intent.Extras.KeySet())
            {
                var value = Intent.Extras.GetString(key);
                if ("channelId".Equals(key) && !string.IsNullOrEmpty(value))
                {
                    LocalStorageSettings.SelectedChannelId = Convert.ToInt32(value);

                    Xamarin.Forms.Device.BeginInvokeOnMainThread(async () =>
                    {
                        ((MasterDetailMainPage)App.Current.MainPage).Detail = new CustomNevigationPage(new ChannelListPage());
                        await ((MasterDetailMainPage)App.Current.MainPage).Detail.Navigation.PushAsync(new ChannelNoticeListPage());
                        ((MasterDetailMainPage)App.Current.MainPage).SetAction("Channels");
                    });
                }
               }
        }
             ..................
    }
Sign In or Register to comment.