Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not show privacy screen when app is in foreground while inactive #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jonathanli2
Copy link

Hi,
This change is for not showing privacy screen when the app is still in foreground but may temporarily inactive, for example, when showing the ios native touch id dialog, or when user using splitview slide, or when sliding from top to show the device status bar.

I saw there is already another pull request for this issue, #26
but think that pull request may cause some side effect, so would suggest to fix the issue by changing the privacy plugin's notification handler from

UIApplicationDidBecomeActiveNotification
UIApplicationWillResignActiveNotification
to
UIApplicationWillEnterForegroundNotification
UIApplicationDidEnterBackgroundNotification

This also follows better with Apple's UI guide, as when the app is still in foreground, the app should still show the meaningful content to user.

Thanks
Jonathan

@jonathanli2
Copy link
Author

Hi,
Just tested the change on both ipad2 simulator and iphone 5s device, and it works as expected.
I shared the iphone screen recording at

https://youtu.be/1D_BI5n6vEY

The testing project only has a statusbar plugin and privacyscreen plugin.

Note during the recorded testing I first clicked the home button to verify the privacy screen function. Then the second time I double clicked the home button, since at that time, the app still did not enter background, so the privacyscreen will not show, but once another app or home screen was selected to become active app, then the testing app will enter background, and the privacy screen would apply.

If you still get problem in your testing, could you share the prototype project or a screen recording so that I can follow it to repeat the issue?

Thanks
Jonathan

@devgeeks
Copy link
Owner

This is a tough one. I have been agonising over this a bit.

On the one hand, I don't want it to go all splashscreen whenever the touch ID modal pops up... But on the other hand, I would like it to pop up as soon as the task switcher is used.

I think this PR is probably the lesser of the two evils. I will probably just go ahead and merge it this week, but I expect many issues raised because of it :/

@devgeeks
Copy link
Owner

I was just looking at how 1Password handles this and it's the same as your PR. Pretty sure I am going to pull this in. Sorry for the delay.

…t view; Support ios new ios info plist launch image key; Using portait launchimage for iphone 5/6 landscape mode
@jonathanli2
Copy link
Author

Hi,
Found some issues while testing the privacy screen plugin on ipad pro and other devices, and a new update was added in the pull request.
Line 40: always use screen size when taking privacy screen image, as the privacy screen is always shown in full screen size after double tabbing the home button
Line 41: allow resize the privacy image view size to parent view, so privacy screen will not show partially after device orientation change
Line 83: the new xcode 8 no longer generates UILaunchImageFile in info.plist in app bundle, instead UILaunchImages is preferred.
Line 119: When iphone 5/5s/6 runs on landscrape mode, it is better to show the portrait privacy image, instead of showing a black screen by setting imageName to nil.

Thanks
Jonathan

@devgeeks
Copy link
Owner

Gonna merge this tomorrow probably... but I think it might be time for you to get commit privileges on this repo ;)

@SvenTobback
Copy link

@devgeeks Friendly reminder that this still isn't merged. :)

@devgeeks
Copy link
Owner

I really wanna update this, but is there any chance of a quick repro to test it?

I don't actually have any apps that use Touch ID.

@jonathanli2
Copy link
Author

Hi,
I have shared an ios project to demo this issue when touch id is used. The project and the related screen shot is available at:
https://mdocs.sap.com/mcm/public/v1/open?shr=4OKI1UkwNnfA3Bi7aEFya1g5NKSunTaDDx06cIei9xo

Steps to repeat the issue:

  1. build and run the project on ipad device (screen1), and click log in button on the screen
  2. input "https://www.google.com" in the first textbox field (screen2), and click ok button
  3. input "password" in both set password and confirm password fields, and also check "Enable unlock with fingerprint" checkbox (screen3), then click ok button
  4. in the next tip screen, click continue button (screen4)
  5. the app should show the google web page (screen5)
  6. kill the application and restart it
  7. the app will show the touch id screen with privacyscreen behind it (screen6). This is not expected.

If replacing the privacyScreenplugin.m with the updated file in the shared folder (privacyscreen.m.withfix), then repeating the step 7, the app will have the expected behavior of showing application UI screen behind the touch id screen (screen7)

Please let me know if you get any issue when using the project to repeat the issue.

Thanks
Jonathan

@devgeeks
Copy link
Owner

devgeeks commented Nov 8, 2017

@jonathanli2 Thanks SO much for that. I'll look at this asap.

@jonathanli2
Copy link
Author

Hi,
We got another customer reports the black screen due to this issue. Just wonder whether the pull request is still under evaluation?

Thanks
Jonathan

@RobinGiel
Copy link

Hi @devgeeks I'm having the same problem as @jonathanli2 is there any solution for this or a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants