Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3806328
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:49:06+00:00 2026-05-19T14:49:06+00:00

My app supports pin code for my users and I was asked to show

  • 0

My app supports pin code for my users and I was asked to show the pin code every time the app returns from multitasking or the device returns from sleep.
In order to make sure the first thing the user sees is the pin code screen and not the real data for a sec before seeing the pin code, I am watching the applicationDidEnterBackground and applicationWillResignActive methods.
The problem is that applicationWillResignActive is called on many occasions like when the user is double tapping on the home button, gets an SMS or push notification, on tries to purchase an in app purchase request.
Is there a way for me to separate all of those cases and simply recognize the auto sleep of the device or the case when the user taps on the sleep button?

Thanks

Roi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T14:49:07+00:00Added an answer on May 19, 2026 at 2:49 pm

    There isn’t a direct way to differentiate all the reasons why your app enters the background mode. You can, however, call CFAbsoluteTimeGetCurrent() in applicationWillResignActive:, save the time stamp, and check if enough time has passed in applicationDidBecomeActive: to warrant showing PIN code entry. For example, if less than 10 seconds has passed, you can skip showing PIN code entry. This does make your app less secure, but then it will nag users a bit less too.

    While this solution may look far from being ideal, in fact, it doesn’t matter why your app resigned its active state. Whatever the reason, it may become active after a very long time, and it may as well never become active again if iOS decides to terminate it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app supports HDMI Output. I asked the code for the resolution of the
Our app supports different browser version from IE to Firefox to Chrome. Now, some
My app supports users down to 1.6 (API level 4) and I want to
I have an iPhone app that supports all device orientations, but I have a
I'm writing a web app that supports multiple users. Each user has their own
Our universal app supports opening pdf files from other apps, but we only want
I was asked to build a playbook app using HTML5. That's the first time
My app already supports localization in English and French with custom images and .strings.
I hope to create a single app that supports both the iPhone and the
The latest Google App Engine release supports a new Task Queue API in Python.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.