An annoying iOS 7 behavior

A couple of common practices in mobile apps that help spread the install-base of apps:

Have a "share" action somewhere in the app that will attach a link to the app's web landing page.

Detect mobile traffic on the landing page and automatically redirect the user to the App Store to get the app without needing the user to click on an intermediate link on the landing page.

These two steps combined are a common "viral loop" to gain more users. Now with iOS 7, however, things get weird.

The Twitter and Facebook share sheets do live webview previews of any attached URLs. These preview webviews also run javascript, and since the share sheets are, of course, being run on a mobile device, the user completing the share step is suddenly thrown out of the app and redirected to the App Store.

This is a terrible behavior for users to encounter. Worse yet, if the user goes back to the app, sometimes (indeterminately) the share sheet disappears and the corresponding delegate/completion blocks are not called.