0

i tried evrything in this link.

How to set a whitelist in web view with Android Management API Below is my code on api. Any help will be appreciate

    { 
        "packageName": "com.android.chrome", 
        "installType": "FORCE_INSTALLED", 
        "managedConfiguration": { 
                                 "URLBLacklist": ["*"], 
                                 "URLWhitelist": ["youtube.com"] 
         }, 
         "defaultPermissionPolicy": "GRANT"
 }
vishu
  • 11
  • 5

2 Answers2

0

your json format should be following

{ "packageName": "com.android.chrome", "installType": "FORCE_INSTALLED", "managed_configuration": { "URLBlacklist": ["*"], "URLWhitelist": ["https://www.youtube.com"] }, "defaultPermissionPolicy": "GRANT" }

user2893186
  • 125
  • 1
  • 2
  • 10
  • Hi appreciate your response Which code are sahring above is work on your site try it but not work on my site. your code work on chrome. i am begginer in this. did u add anything else please help me – vishu Jun 16 '20 at 11:13
  • what do you mean by your own site?you can allow for any app.just replace your package name instead of chrome and add list of url as your need. – user2893186 Jun 16 '20 at 12:57
  • { "screenCaptureDisabled": true, "cameraDisabled": true, "systemUpdate": { "type": "WINDOWED", "startMinutes": 120, "endMinutes": 240 }, "applications": [ { "packageName": "com.android.chrome", "installType": "FORCE_INSTALLED", "managedConfiguration": { "URLBLacklist": [ "*" ], "URLWhitelist": [ "https://www.google.com" ] }, "defaultPermissionPolicy": "GRANT" } ] } i tried this policy i am not able to block all url exept youtube. Any mistake or missing. – vishu Jun 17 '20 at 10:28
0

Managed configuration keys are key-sensitive. URLBLacklist should be written as URLBlacklist

The policy below should work:

            { 
                "packageName": "com.android.chrome", 
                "installType": "FORCE_INSTALLED", 
                "managedConfiguration": { 
                    "URLBlacklist": ["*"], 
                    "URLWhitelist": ["youtube.com"] 
                }, 
                "defaultPermissionPolicy": "GRANT"
            }
Dave Paurillo
  • 231
  • 1
  • 12