“I was looking at Facebook, and now I've got a popup that says I have a virus and I have to click OK!” - This is all too common a problem, increased if you click on “clickbait” articles from questionable sources. Sometimes they will appear on other apps as well. FYI clicking OK actually doesn't seem to do anything bad, in fact nothing happens and the message goes away, but it's irritating and I wonder what it's doing behind the scenes with my "ok." So far, the only solution I've found is to:
1. “Quit” Facebook by double-clicking the home button (iPhone) or swiping up to Control Center (iPad) so all of your open apps line up, and swiping up on Facebook to make it fly away, thus quitting it.
2. Go to Settings – Safari – and scroll to the bottom and click Clear History and Website Data. Then click Clear History and Data. Yes, I know FB is not Safari but it seems to store its data in Safari, so this is the workaround I've found.
There are numerous articles on it. Some App developers want you to screenshot it and report it, but it's usually bounced around and hidden in legit ads so it's hard for them to stop it too. Here's a forum for a bit more info: https://forums.macrumors.com/threads/facebook-app-popup-mobile-scanner-com.2043434/
While we're at it, let me state that you're usually fairly safe from viruses on iPhones and iPads (for now) because Apple checks all of the apps in the app store for malware before allowing them to be sold. However, this doesn't protect you from Clone sites that seek to steal your account name / password / credit card info, so remember, ONLY enter those things on secure sites that you have typed in the web address yourself, like www.icloud.com, DON'T click on suspicious "verify your account" or "you've been charged by Apple, click to dispute" links in emails, and try not to access secure sites that require a name and password when you are on unprotected public wifi networks, such as coffee shop networks.