简体   繁体   English

如何从 iOS 的电话设置中检查用户是否启用/检查了自动填充凭据提供程序扩展?

[英]How to check whether user has enabled/checked autofill credential provider extension or not from phone settings in iOS?

I have implemented AutoFill Credential Provider Extension in iOS.我已经在 iOS 中实现了AutoFill Credential Provider Extension
Everything is working fine but I am having one issue, not exactly an issue but I am unable to achieve the below functionality.一切正常,但我有一个问题,不完全是一个问题,但我无法实现以下功能。

I want to get Autofill extension state every time when user open a specific viewController of my application.每次当用户打开我的应用程序的特定视图控制器时,我都想获得Autofill扩展viewController
So that I am able check whether it's enabled from settings or not.这样我就可以检查它是否从设置中启用。

If it is not enabled I will navigate user to phone settings otherwise user can use the app.如果未启用,我会将用户导航到手机设置,否则用户可以使用该应用程序。

As documented we need to use ASCredentialIdentityStore state for that purpose:如文件所述,我们需要为此目的使用ASCredentialIdentityStore state:

演示

so you can add somewhere the following wrapped async call and use it to validate of extension is enabled:因此您可以在某处添加以下包装的异步调用并使用它来验证扩展是否启用:

- (void)checkExtesionEnabledWithCompletion:(void(^)(BOOL))completion {
    ASCredentialIdentityStore *store = [ASCredentialIdentityStore sharedStore];
    [store getCredentialIdentityStoreStateWithCompletion:^(ASCredentialIdentityStoreState * _Nonnull state) {
        completion(state.isEnabled);
    }];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检查用户是否从设置中启用了推送通知? - How to check if the user has enabled push notification from the settings? 如何实现 AutoFill Credential Provider Extensions - iOS 11、swift4 - How to implement AutoFill Credential Provider Extensions - iOS 11, swift4 如何在 xamarin 中为 iOS 12 添加凭据提供程序应用程序扩展 - How to add a credential provider app extension for iOS 12 in xamarin 如何在 iOS App 中检查 FACEID 是否已被用户禁用? - How to check whether the FACEID has been disallowed by the user in iOS App? 如何以编程方式检查用户是否为 iOS 应用程序启用了计划摘要通知? - How to check programmatically whether the Scheduled Summary notifications is enabled by a user for an iOS app? iOS:如何检查是否启用了触觉反馈(iOS 设置) - iOS: How to check is Haptic Feedback enabled (iOS Settings) 如何正确检查用户是否已启用“允许完全访问”自定义键盘扩展名 - How to properly check if user has enabled “Allow Full Access” to custom keyboard extension 如何检查 iOS/iPadOS 中是否启用了暗模式? - How can I check whether dark mode is enabled in iOS/iPadOS? 如何检查iOS键盘中是否启用了听写功能? - How to check whether Dictation is enabled in iOS Keyboard.? 如何检查 iOS 设备上是否启用了 Motion & Fitness? - How can I check whether or not Motion & Fitness is enabled on an iOS device?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM