Lyle Pratt
Lyle Pratt

Reputation: 5956

What is the Equivalent of Android's CordovaPlugin remapUri Override for iOS Cordova Plugins

I need to alter the URL that the Cordova WebView loads on launch programatically. On Android, I see that I can override remapUri using the CordovaPlugin interface. However, I do not see a similar or equivalent method for iOS Plugins. Does anyone know how to accomplish something similar on iOS?

Many Thanks, Lyle

Upvotes: 0

Views: 586

Answers (1)

Shih-You Yeh
Shih-You Yeh

Reputation: 71

Though a little bit late. But yes, there is.

You can intercept urls via overriding

- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType

in your custom plugin. Return Yes when you'd like to handle the url yourself.

Check out https://github.com/joyxuLogic/cordova-plugin-iframelinks/blob/master/src/ios/IFrameLinks.m

Upvotes: 2

Related Questions