TouchID calls applicationWillResignActive and applicationDidBecomeActive

前端 未结 2 1743
甜味超标
甜味超标 2021-02-03 23:55

I am wondering if this is intended by Apple that these lifecycle methods are called upon using TouchID functionality.

Is there any possibility to check if the touchID pr

2条回答
  •  温柔的废话
    2021-02-04 00:47

    You can create a static bool in your login script that you can check from your AppDelegate!

    static var isShowingTouchID = false
    

    Then before your context.evaluatePolicy call, you can set it to true, and in the callback function, set it to false. I believe you use the reply argument to set a callback to this.

    Then in your AppDelegate, check the status of this bool.

    Originally I was using a public variable in AppDelegate and setting that, but I feel similarly in that I didn't want to do that. Frankly, I don't like this solution either, but it was the only one I could come up.

    I even tried overriding viewDidDisappear in my login script, but I quickly found out that it was not being called even when I tapped "Cancel" on the touch ID prompt.

    If anyone has a better solution, I would love to know.

提交回复
热议问题