Asmita Patil
Asmita Patil

Reputation: 61

i have followed all the steps of trusted web activity but still address bar is visible using chrome dev..how to get webview in trusted web activity?

This is the screeenshot of our android app but when it opens the address bar is visible as shown how to hide that url(address bar) using trusted web activity?

screenshot here we have also used Chrome Dev as our default browser but it is not wroking every time when we open the android application. please suggest solution for this. thanks in advance!

Upvotes: 6

Views: 1119

Answers (2)

Jake
Jake

Reputation: 2655

You may have opted into having Google Play sign your releases with a key they generated, and only use your key for the upload.

If you did, simply copy the App signing certificate SHA-256 fingerprint under Release Management -> App Signing into the assetlinks.json file.

Upvotes: 2

Mohammed Ali
Mohammed Ali

Reputation: 103

Google needs to verify that the owner of the website and the owner of the app is the same. In order to perform this verification it will look for an assetlinks.json at the location /.well-known/assetlinks.json

This assetlinks.json should contain the sha256 of the corresponding android app along with the package_name, namespace and some other information as shown here.

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "org.chromium.twa.svgomg",
    "sha256_cert_fingerprints": [
          "82:04:C5:DB:19:A8:B9:8A:27:14:F0:3E:F5:23:2C:6B:B6:B9:63:10:F2:F9:CD:44:72:AA:C6:7E:09:E1:1C:47",
          "91:45:8F:34:E3:13:E4:58:1C:12:21:7A:FD:1E:BD:5C:BE:9B:DE:2C:1E:57:DC:0D:2B:0E:91:1D:A6:36:CA:E8"
        ]
      }
    }]

You will also need to update the AndroidManifest.xml as shown below.

<application>
    ...
    <meta-data android:name="asset_statements"
android:resource="@string/asset_statements" />
    ...
  </application>

For this to work we need to add the asset_statements in the strings.xml file as below.

<string name="asset_statements">
        [{
            \"relation\": [\"delegate_permission/common.handle_all_urls\"],
            \"target\": {
                \"namespace\": \"web\",
                \"site\": \"https://svgomg.firebaseapp.com\"}
        }]
</string>

back slashes are compulsory. After all this is done make sure that you are targetting chrome dev cause as of Chrome 70, TWA is not supported.

Upvotes: 0

Related Questions