Skip to content

Commit

Permalink
Merge branch 'plugin-api' into configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ikeith committed Nov 9, 2020
2 parents b8da534 + 5b13e78 commit ce2cb01
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import android.app.Activity;
import android.content.SharedPreferences;
import com.getcapacitor.JSObject;
import com.getcapacitor.NativePlugin;
import com.getcapacitor.Plugin;
import com.getcapacitor.PluginCall;
import com.getcapacitor.PluginMethod;
import com.getcapacitor.annotation.CapacitorPlugin;

@NativePlugin
@CapacitorPlugin
public class WebView extends Plugin {

public static final String WEBVIEW_PREFS_NAME = "CapWebViewSettings";
Expand All @@ -18,15 +18,15 @@ public class WebView extends Plugin {
public void setServerBasePath(PluginCall call) {
String path = call.getString("path");
bridge.setServerBasePath(path);
call.success();
call.resolve();
}

@PluginMethod
public void getServerBasePath(PluginCall call) {
String path = bridge.getServerBasePath();
JSObject ret = new JSObject();
ret.put("path", path);
call.success(ret);
call.resolve(ret);
}

@PluginMethod
Expand All @@ -36,6 +36,6 @@ public void persistServerBasePath(PluginCall call) {
SharedPreferences.Editor editor = prefs.edit();
editor.putString(CAP_SERVER_PATH, path);
editor.apply();
call.success();
call.resolve();
}
}

0 comments on commit ce2cb01

Please sign in to comment.