How can i get the device name in swift5 and send it with the wkwebview url. If i print the name i get the model name but with the following code i get the error Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value.
let name = UIDevice.current.name
let url = URL(string: "mydomain/index.php?token=\(token ?? "")&model=\(name)")!
webView.load(URLRequest(url: url))
I need the device name and token to store in a mysql database. Thank You!