iOS app will save password but will not autofill - ios

I have associated domains set up with my app & api, so apple is asking to save my passwords, but they will not autofill.
Here is my AD:
Here is XCode where I set the content type:
NOTE: The text field input placeholder is "Email", because we use the email as the username.
I even set them programmatically as well. I have tried deleting the app, restarting my phone and deleting the app, deleting the text fields and recreating them, all to no avail.
What is really weird is that autofill for email does not work in my signup form either, but only for that text field. So, I have a first name text field - that will autofill my name, but if i switch that to "Email", then it will autofill email successfully. Then, I copy that text field, move it into position, delete the old one, change one of them back to "first name" and now it doesn't work. This is so weird, it makes 0 sense.
Once I log in, it asks to "Save Password", no matter how many times I log in. It does not ask to "Update Password". When I sign in the second time, I click on "Passwords" and it shows the password I created, attached to my associated domain, under suggested passwords. If I click here, it will load the password. But why is it not autofilling? What am I doing wrong?
I have verified that it autofills in other apps, I just tried w/ CapitalOne

The issue was the path of the associated domain. This is an apple bug. For the associated domain, I was using webcredentials:api.companyname.com/v1. The "v1" was the issue. It compiles, runs, and saves the domains with the v1. It appears that about half of the associated domains functionality still works if you include a path, but half doesn't, with no indication of the error. However, when you prepare for submission to the app store by archiving the app, it will fail. When I removed the path, it started to work 100%.

Related

Swift/iOS - Use Strong Password not being saved to keychain

I am attempting to implement the autofill feature for iOS. I have followed all the steps from https://developer.apple.com/documentation/security/password_autofill. I have an associated domain, a valid apple app association file, and I have set the text content types correctly. My issue is, when I am prompted to "use strong password" by the native iOS dialog, my username/password never gets saved to the keychain. I have also validated that I have autofill on and my icloud keychain enabled. Ive also followed https://medium.com/developerinsider/ios12-password-autofill-automatic-strong-password-and-security-code-autofill-6e7db8da1810 , but still not seeing the expected behavior. By clicking use strong password, is the username/pw automatically sent to keychain or do I need to manually do something. Thanks in advance.
actually watched developer.apple.com/videos/play/wwdc2018/204/?time=31 . Turns out the issue is not removing the user/pw/confirmPw from the view hierarchy. So on my "viewWillDisappear" I am removing the fields from the hierarchy, this triggers the save to keychain.

Automatically enter name/phone/email etc

I may be searching for the wrong thing, which might explain why I can only find information on setting up password autofills.
I'm looking for the ability to for a user to enter email, phone, first + last names in an app, the same way some websites are able to do it, the options appearing above the keyboard.
I have the fields content type set in the storyboard (Name, Telephone Number, Email Address)
Can anyone advise if this is possible and how I go about doing this.
Password Autofill is the only feature that automatically does that on IOS Apps.
The other feature you are talking of "Contact Auto Fill" that you say happens on some websites on your mobile is a feature implemented in the Safari App.
If you go to your IOS settings and open Safari Settings, you'll see you can select a contact to use for contact and credit card autofill.
Safari Settings Screenshot Safari Settings Screenshot2
To get such a feature, you would have to manually implement.
Automatic availability of such feature would probably have privacy concerns to user (meaning you can auto extract true user contact information by just making such a form in your app).

Why is my iOS App Associated Domain endpoint not being called by Apple?

Following Apple's Password autofill guidelines with App Associated Domains here, I added the apple-app-site-association json file.
My app has that site listed as webcredentials:example.com. My app's bundle id is com.app.App which is listed as one of the apps under webcredentials.apps. The site has an SSL certificate.
In my iOS app I have an email text field with a content type of email (I've also tried username) and I have a password text field with new password (I've also tried password). When I select the email text field I get suggested emails. But when I select the password text field I get the same email QuickType suggestions and I get an error in the console:
Cannot show Automatic Strong Passwords for app bundleID: com.app.App due to error: Cannot save passwords for this app. Make sure you have set up Associated Domains for your app and AutoFill Passwords is enabled in Settings
I have AutoFill Passwords enabled on my device and I've proved that it does work on other apps.
I also never see in the logs that apple is calling my endpoint I provided above.
I verified that my Apple team ID is correct.
I've run out of ideas. Can someone else see what I'm doing wrong? Thanks!
Update:
It works fine on the simulator. The request goes out and the server gets it and it works. On the device it does NOT work.
I turned off the phone and turned it back on and it's working just fine... Really frustrating, I have no idea why it wasn't working, but I do know it was NOT making the network request from the device at all.
I turned off the phone I was testing with and turned it back on and that somehow fixed it... I have no idea why it wasn't working, but I do know it was NOT making the network request from the device at all.

Can I use iOS AutoFill feature only in app without associated domain?

I am wondering if I can use AutoFill without implementing the Associated Domains?
So this means for example that when the user register in my app that I save the credentials.
And then when he tries to login offer this credentials as AutoFill option.
Is something like that even possible to achieve?
As far as I can tell, you can take advantage of AutoFill without setting up associated domains. The part you'll miss out on is that iCloud/1Password/etc. won't be able to suggest the right log in details for your app without the associated domains set up. Instead, it'll prompt the user to choose/search for the matching log in details and select them from a list. But it should fill it in for you fine, especially if you add the extra details like setting textContentType on your text fields so iOS knows what's a log in form in your app.
ETA: Actually, I ended up having issues with AutoFill in my app that seemed to be fixed by setting up associated domains. The documentation makes it seem like that step is optional, but I had trouble where 1Password would let me choose the log in details but not fill them into the text fields until I had associated domains set up, whereas iCloud seemed to work fine mostly.

Can't set Facebook test user work position

Like the title says, I'm having problems with the "Position" field for test users. I've been able to create a work history by creating a organization page, but no matter what i set as "Position" it gets blanked out when I hit save. The problem is, this is the only field we use in our app, and since we haven't been able to add this for a test user, Facebook refuses to approve our app.
To be more specific, this is what the browser sends when I add a position from a test account (snatched from chrome dev tools):
position_id:0
position_text:[Whatever text i set as position]
I've seen that for my real account, the position_id is set to a number when I choose one of the pre-existing options, but for test users none of these are available. Is it not possible to do this for test users at all?
Got a response from a Facebook developer group.
"App Test Users can only interact with objects they created and since they cannot create workplaces you cannot test this with App Test Users."
This is partially correct, you can create an organization page as a test user and set that as your workplace. However you can not fill anything in the "Position" (Job title) field. We managed to get around this by setting the field in our own database manually for test users and check that it works for real users.

Resources