jonasman / TeslaSwift

Swift library to access the Tesla API
MIT License
247 stars 71 forks source link

Feature Request: Enable Passwords Autofill #170

Open Krillle opened 7 months ago

Krillle commented 7 months ago

It would be nice, if the public class TeslaWebLoginViewController would trigger the Safari AutoFill option to fill out passwords automatically. It might work with something like this:

  init(url: URL) {
        super.init(nibName: nil, bundle: nil)

        // Enable AutoFill Passwords 
        let config = WKWebViewConfiguration()
        config.websiteDataStore = WKWebsiteDataStore.default()      
        webView = WKWebView(frame: .zero, configuration: config)

        webView.navigationDelegate = self
        webView.load(URLRequest(url: url))
    }
jonasman commented 7 months ago

can you make a PR?

the alternative is to use the native browser, that the lib already supports

Krillle commented 7 months ago

I have the changes here in this Patch-4, but this alone was not triggering the AutoFill.

Btw how to get the TeslaSwiftDemo project running on simulator? I cant find a matching target to run.

Krillle commented 7 months ago

@jonasman how to use the native browser for Tesla login?

jonasman commented 3 months ago

@Krillle you need to open Safari for login, there is a method to get you the URL. then you need to support a deeplink in your app for the Tesla website to open your app again. You must register with Tesla Dev portal that deeplink and then in Xcode.