on develop help sign in
enable Geolocation in WebView Settings
24d2e99hsloan
reflex-dom/java/org/reflexfrp/reflexdom/MainWidget.java+7
@@ -8,6 +8,7 @@ import android.util.Log;
8import android.view.ViewGroup.LayoutParams;
8import android.view.ViewGroup.LayoutParams;
9import android.view.Window;
9import android.view.Window;
10import android.webkit.CookieManager;
10import android.webkit.CookieManager;
11+import android.webkit.GeolocationPermissions;
11import android.webkit.JavascriptInterface;
12import android.webkit.JavascriptInterface;
12import android.webkit.MimeTypeMap;
13import android.webkit.MimeTypeMap;
13import android.webkit.PermissionRequest;
14import android.webkit.PermissionRequest;
@@ -41,6 +42,7 @@ public class MainWidget {
41 ws.setAllowFileAccessFromFileURLs(true);
42 ws.setAllowFileAccessFromFileURLs(true);
42 ws.setAllowUniversalAccessFromFileURLs(true);
43 ws.setAllowUniversalAccessFromFileURLs(true);
43 ws.setDomStorageEnabled(true);
44 ws.setDomStorageEnabled(true);
45+ ws.setGeolocationEnabled(true);
44 wv.setWebContentsDebuggingEnabled(true);
46 wv.setWebContentsDebuggingEnabled(true);
45 // allow video to play without user interaction
47 // allow video to play without user interaction
46 wv.getSettings().setMediaPlaybackRequiresUserGesture(false);
48 wv.getSettings().setMediaPlaybackRequiresUserGesture(false);
@@ -109,6 +111,11 @@ public class MainWidget {
109 public Bitmap getDefaultVideoPoster() {
111 public Bitmap getDefaultVideoPoster() {
110 return Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888);
112 return Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888);
111 }
113 }
114+
115+ @Override
116+ public void onGeolocationPermissionsShowPrompt (String origin, GeolocationPermissions.Callback callback) {
117+ callback.invoke(origin, true, true);
118+ }
112 });
119 });
113
120
114 wv.addJavascriptInterface(new JSaddleCallbacks(jsaddleCallbacks), "jsaddle");
121 wv.addJavascriptInterface(new JSaddleCallbacks(jsaddleCallbacks), "jsaddle");