Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Reproduces on iOS 7.1 simulator, and 7.1 and 8.4 devices. May not reliably reproduce on 8.4 simulator.
1) Press the button on the default page. It goest to the secret page.
2) iOS Home button to collapse the app.
3) Re-open app. Notice that the "Secret Page" is visible for a moment and then the default page comes back up.
I have checked this issue with the help of sample app attached in bug description and able to reproduce this issue.
I have checked this issue with iOS 7.1 simulator.
Ide Log: https://gist.github.com/Asimk360/a2cc7020b7a247a55742
iOS designer Log: https://gist.github.com/Asimk360/18adb91bf2fd0b4d7f3e
=== Xamarin Studio ===
Version 5.9.6 (build 5)
Installation UUID: 449f40dd-b3f1-4028-9a6b-cca0d1a2307d
Mono 4.0.3 ((detached/9253c5a)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400040022
=== Apple Developer Tools ===
Xcode 5.1.1 (5085)
=== Xamarin.Mac ===
Version: 22.214.171.124 (Enterprise Edition)
=== Xamarin.Android ===
Version: 126.96.36.199 (Enterprise Edition)
Android SDK: /Users/360logicaxamarinmacmini/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
5.0 (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
=== Xamarin Android Player ===
=== Xamarin.iOS ===
Version: 188.8.131.52 (Enterprise Edition)
Build date: 2015-08-16 03:57:11-0400
=== Build Information ===
Release ID: 509060005
Git revision: cb62759e77800e955a08a3f2f4feeabe9b5bc8af
Build date: 2015-07-30 16:30:30-04
Xamarin addins: c6796e57050161f3689c87a82fdb1c87a28ac633
=== Operating System ===
Mac OS X 10.10.0
Darwin 360LogicasMacmini.local 14.0.0 Darwin Kernel Version 14.0.0
Fri Sep 19 00:26:44 PDT 2014
This app prevents any Xamarin.Form iOS secure app (log out/hide private info on backgrounding app) from being secure. Does anyone at xamarin know a workaround until this gets resolved?
This is not a Xamarin.Forms issue. iOS actually takes a screenshot of your app just before it minimizes it and returns to the home screen. When you tap the app to bring it back to the foreground what you see zooming in is the screenshot it took. It does this because actually resuming your app's process takes some time therefore to make it appear faster to the user they temporarily show the screenshot. This is the behavior you are seeing.
To get the behavior you want try moving your code in the DidEnterBackground method to the OnResignActivation method. DidEnterBackground gets called after iOS has already taken the screenshot while OnResignActivation gets called before the screenshot is taken.
That is not correct.
On resign activation is not the solution. If you use any common bank app where they log out on background it does not logout on resign activation, because that also fires when you look at all the apps in the App Switcher but don't leave your app.
If I were to replace it on Activation like you are suggesting it would log out every time the person went to the app switcher then immediately selected the app again. Also it would occur every time they accidentally swiped down form the top or bottom. (Which occurs a lot...)
I had this behavior working before, it was broken with a recent update 1.4.Xish. Your answer is not correct and pollutes this bug thread and I hope you will delete it if possible.
This fixes the issue as far as I can tell. I will test it on devices tomorrow to double check.
public override void DidEnterBackground(UIApplication uiApplication)
App.Current.MainPage = new DefaultPage();
Specifically the SnapshotView(true) call fixes it.
Marking this as fixed because the solution I've posted above doesn't involve Xamarin.