Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigate to CDV_LOCAL_SERVER after setting server base path #132

Merged
merged 2 commits into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
((IonicWebViewEngine)webView.getEngine()).setServerBasePath(path);
webView.loadUrl(webView.getUrl());
}
});
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public void onPageFinished(WebView view, String url) {

public void setServerBasePath(String path){
localServer.hostFiles(path);
webView.loadUrl(CDV_LOCAL_SERVER);
}

public String getServerBasePath() {
Expand Down
2 changes: 1 addition & 1 deletion src/ios/CDVWKWebViewEngine.m
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ -(void)setServerBasePath:(CDVInvokedUrlCommand*)command
{
NSString * path = [command argumentAtIndex:0];
[self setServerPath:path];
[(WKWebView*)_engineWebView reload];
[(WKWebView*)_engineWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.CDV_LOCAL_SERVER]]];
}

-(void)setServerPath:(NSString *) path
Expand Down