Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

OnSleep/OnResume not working on iOS app

$
0
0

It doesn't appear that OnSleep()/OnResume() is working for my iOS app. OnStart() seems to work fine, and all 3 lifecycle methods are working on Android version of the app. I'm on v1.4.1. The code is pretty straightforward, but I'll post it anyways:

    public App()
    {
        var disclaimerPage = new DisclaimerPage();
        disclaimerPage.AcceptedDisclaimer += HandleAcceptedDisclaimer;
        MainPage = disclaimerPage;
    }

    private void HandleAcceptedDisclaimer(object sender, EventArgs e)
    {
        MainPage = new NavigationPage(new MainPage());
    }

    protected override void OnStart()
    {
        Debug.WriteLine("***Starting up the app***");
    }

    protected override void OnSleep()
    {
        // Handle when your app sleeps
        Debug.WriteLine("***Going to OnSleep***");
    }

    protected override void OnResume()
    {
        // Handle when your app resumes
        Debug.WriteLine("***Resuming operation***");
    }

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>