Print

Trusted Web Activity is a new solution to open web-app content in apps like Progressive Web App (PWA) and uses a protocol based on Custom Tabs. Chrome 72 and above versions for Android support TWA.

TWA displays a fullscreen browser in your Android app and allows you to use all the features and services of that browser.

Content in Trusted Web Activity is trusted, and the application and website certainly come from the same developer. This fact is verified using Digital Asset Links. For further information, see this link.

While uploading a WebView package on Bazaar, the developer of the application and website is verified automatically. Be careful to follow Bazaar’s publishing guidelines for uploaded TWA apps like other applications.

Verification of the TWA applications on Bazaar is as the following: 

1. Build the application based on this link

Note: To convert PWA to TWA, use this online tool

2. The created manifest for the application must contain the following tag, and its value must be the host of the application: 

<meta-data android:name="android.support.customtabs.trusted.DEFAULT_URL" android:value=<HOST URL>/>

3. To detect and verify TWA applications, insert the assetlinks.json file in the following path: 

<HOST URL>/.well-known/assetlinks.json

4. The assetlinks.json file structure must be as following: 

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": <PACKAGE NAME>,
    "sha256_cert_fingerprints": [SHA_1, SHA_2, ... ]
  }
}]

To verify your app with Bazaar, add the following relation to the above file:

{
    "relation": [
      "check_validation"
    ],
    "target": {
      "namespace": "cafebazaar_twa",
      "package_name": <PACKAGE_NAME>
    }
  }

By adding this relation, the assetlinks.json file format would be as the following: 

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": <PACKAGE NAME>,
    "sha256_cert_fingerprints": [SHA_1, SHA_2, ... ]
  }
},
{
    "relation": [
      "check_validation"
    ],
    "target": {
      "namespace": "cafebazaar_twa",
      "package_name": <PACKAGE_NAME>
    }
  }]
Was this content helpful?
Write your comment here...

If you have any comment on this content or any idea to make it better, use this form to send us your comment.

Publish Date: 1400-04-10 14:51

Latest Update: 1400-05-16 06:54