Swift: saved Credential Identities doesn't show up in the quicktype bar

Viewed 254

With password autofill in iOS 12, users can save passwords either on iCloud or any third party password managers.

I have a third party password manager, after adding a new account and password to my database, I add the the credential to the ASCredentialIdentityStore.shared.saveCredentialIdentities

I want to add the newly created account into the QuickType Bar directly(the most relevant one), but the saved Credential Identities doesn't show up in the bar (it always show the first added one), but I can find it at action sheet from clicking the little key button in the QuickType Bar. enter image description here

           var autoFillArray = [ASPasswordCredentialIdentity]()
           ASCredentialIdentityStore.shared.getState({state in
                   if state.isEnabled {
                          
                                    let domainIdentitier = ASPasswordCredentialIdentity(
                                        serviceIdentifier: ASCredentialServiceIdentifier(identifier: myDomain, type: .domain),
                                        user: object.username,
                                        recordIdentifier: myRecordIdentifier)
                                    
                                    
                                    let urlIdentitier = ASPasswordCredentialIdentity(
                                        serviceIdentifier: ASCredentialServiceIdentifier(identifier: myUrl, type: .URL),
                                        user: object.username,
                                        recordIdentifier: myRecordIdentifier)
                                    
                            
                            
                                    autoFillArray.append(domainIdentitier)
                                    autoFillArray.append(urlIdentitier)
                                    
                          
                                    ASCredentialIdentityStore.shared.saveCredentialIdentities(autoFillArray, completion: {(_,error) -> Void in
                                            
                                        })
                                    
                                
                            
                            
                        }
                        
                    })
0 Answers
Related