Unless your iPhone is jailbroken, it doesn't have a virus. It is possible, however, that you have received a pop up from Safari, which is not likely to be legitimate, or something else going on. It would be helpful to know what the entire message says; could you let us know? A screen shot, if possible, would be wonderful.
Ignore the bogus advice, and delete any app that's involved in such bogus notifications.
I got out of the app and the warning was gone. It said my phone was infected with a virus and if I disnt take action in 24 hours my phone would lock.
Oh, OK! That is not an actual virus, but a pop up. Your app could have triggered it, or something running in your browser. It's not an actual threat, though--so don't worry.
To reduce the chances of triggering that message, and ones like it, again, try the following:
Close your open apps by double-clicking the Home button and sliding their mini window off the top of your screen. Then go into Settings > Safari > Clear history and data.
Good luck!
Didnt*
Thank you! :)
I was playing an app game and got a virus notice saying my phone would lock after 24 hours. Is this real? What do I do?