It sounds like the native iOS app code can receive events whenever a link is clicked within a UIWebView
, but is this still true when the link is within an iframe
within the UIWebView
?
See here, here, here, and etc.
In our case, we just want to display a blog post (etc) within an iframe
, with that iframe
wrapped by a bare html document. But if they click any links from there, we want to have the app detect that and have it navigate outside of our app to the external browser (perhaps with an alert warning first). The links I listed above seem to say this is possible, but is it possible when within an iframe
? I notice that in one of the answers above, in the comments the questioner asked this same question, but no answer was given.
PS The reason we need to do this is because of Apple's policy of restricting apps that have any links to giving or charitable donations, even if our link is to a simple blog page (on for instance a church website). In some cases, even if they had to navigate 4 links in before finding any charitable giving links, they still invalidated the app. So we are hoping it is possible to detect link clicks within an iframe which would make sure any possible hits to a giving page occurs outside the app. Thanks
EDIT: Please do not misunderstand! We are trying to conform to a T with the specifications. All we want to do is display a stinking blog page in a UIWebView, but since sometimes those pages, esp. with customers like churches, have Give links on their websites, it has caused some submissions to fail, even though the link we were bringing up was NOT a give page. This solution should completely conform. We already guarantee and watchdog that any of our customers only put up a link (like a blog link) that is not a direct give page. This solution would make sure any links clicked after that within the webview jump out to the external app, which would guarantee an iframe in our app never leads to a give page. Believe me, this is a huge pain to even have to do, but we're looking into this possible solution because we are trying to dot every I and cross every T of the spec.