Hi Albert,
Thank you for the links. After reviewing both documentation pages, I've implemented a complete test following the specifications, but password autofill is not working.
AASA File (accessible at http://localhost:8080/.well-known/apple-app-site-association):
{
"webcredentials": {
"apps": ["ZW962TGA3F.com.test.PasswordAutofillTest"]
}
}
- ✅ Served with
Content-Type: application/json - ✅ Verified accessible via curl
- ✅ Team ID matches Apple Developer account
Associated Domains Entitlement:
webcredentials:localhost:8080
- ✅ Configured in both Debug and Release entitlements
- ✅ Bundle ID:
com.test.PasswordAutofillTest
SwiftUI Implementation:
TextField("Email", text: $email)
.textContentType(.username)
SecureField("Password", text: $password)
.textContentType(.password)
Authentication Flow:
- App sends POST to
http://localhost:8080/login with credentials - Server returns 200 OK
- App displays "Login successful"
- Server logs confirm request received and processed
❌ No "Save Password" prompt appears
❌ No autofill functionality
After researching the documentation you provided, I noticed the Password AutoFill documentation focuses on iOS (UIKit) and mentions AppKit for macOS, but doesn't specifically address SwiftUI on macOS.
The documentation states:
"AppKit-based apps have full support for password and security code AutoFill starting with macOS Big Sur. AppKit has NSTextContentType..."
My test app uses SwiftUI TextField/SecureField, not AppKit NSTextField.
Question: Does password autofill work with SwiftUI on macOS?
Or is it limited to:
- ✅ iOS UIKit apps
- ✅ macOS AppKit apps (NSTextField)
- ✅ Safari/web browsers
- ❌ macOS SwiftUI apps
If SwiftUI is not supported, this would explain why it's not working despite correct configuration.
- macOS Sequoia 15.1
- Xcode 16.0
- SwiftUI-based macOS app (not AppKit)
- Target: macOS 14.0+
I'm happy to provide the complete test project if helpful. Should I try implementing with AppKit NSTextField instead of SwiftUI to verify if that's the limitation?
Thank you for clarifying whether SwiftUI is supported for password autofill on macOS.
Best regards,
Don Inciso