Need Help with opening a link with the shared.open method

UIApplication.shared.open(URL(string: nfcMessages)!, options: [:], completionHandler: nil)

This throws an error: Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value

please help me understand whats going wrong here cause i tried loading "http://www.google.com" it works but when when i scan an NFC tag and use the payload string in this function it doesnt seem to work at all

What is the content of `nfcMessages`?


`URL(string: nfcMessages)` generates nil when `nfcMessages` is not a valid URL, and crashes as you coded with `!`.

Need Help with opening a link with the shared.open method
 
 
Q