iPhone Trojan Attack Warning
These popups are completely and totally FAKE. All they're meant to do is prey upon your fears as a user. (tl;dr at the bottom)

Most app advertisements are networked, meaning the developer adds a little bit of code to their app, sets what kind of ads they want, and the network lets people buy ad slots. Sketchy ads (like these) pay a lot more, since they're banned from many networks and only some apps allow them (that's usually configurable).

These app advertisements are usually implemented as a custom WebView that only closes once the X appears after a few seconds. As you can see here, these ads also appear in safari, where you have to close the page, and cancel can do whatever the designers want it to do:



A lot of this style of ad also reference the "adult sites you've visited" hoping you won't turn to technical support or the Internet for help.

In reference to you saying that this was made by AnchorFree, that's highly likely. It's an easy (and sadly, effective) way of pushing their product to get more subscribers. Clicking download would've most likely taken you to the HotspotShield install page as well. Your HiDef radio app is probably fine.

tl;dr: your phone is fine, the ad is fake, and AnchorFree probably paid for it. The HiDef radio app is also fine.

PS: I'd be careful about the VPN apps you use, since some will sell your data that they gather through the tunnel they make to advertisers and other people. Read the privacy policy!