If your device can't connect to a Wi-Fi network, contact Apple. Update your Wi-Fi router with the latest firmware and make sure it's compatible with your Apple product. For more information, contact the router manufacturer. If your iPhone doesn't connect to the Wi-Fi network or your iPhone doesn't stay connected to the Wi-Fi network, be careful with the location of the router.
If all else fails (including the iPhone virus scan), contacting Apple directly can help if your iPhone doesn't detect the Wi-Fi connection.