Handling URL Redirects in a UIWebView

I have a UIWebView application in my application that is used to display the link web pages clicked in my application.

Some links are URL shortened links, such as tinyURL or bit.ly. These URLs are redirected after loading the original URL.

My problem is that some links in my application are linked to URLs with shortened links to resources that are not web pages - like video or other media.

I can use webView:shouldStartLoadWithRequest:navigationType: to intercept the URL and decide what to do with it - only it is called only at boot, and not after the redirect.

What can I do to intercept the URL that the bit.ly link points to?

+7
objective-c iphone uikit uiwebview
source share
1 answer

It seems that my excessive mind did not find the time to check the URL loading stream using UIWebView . webView:shouldStartLoadWithRequest:navigationType: redirects. Sorry for wasting any time;)

+11
source share

All Articles