Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create assetlinks.json when website is handled by multiple apps

In order to link my app with the web page in need to define assetlink.json like below.

[{
"relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "package name",
    "sha256_cert_fingerprints":
    [key]
  }
}]

My website having a number of modules, say example in a news site having separate sections like news, car review, garget review, horoscope/astrology, cooking, live tv etc. In this case, the news portal has android app for each module with separate android apps and whereas all the modules are under the single domain. Then how can we define our assetlink.json

like image 976
app explorer Avatar asked Jan 02 '18 05:01

app explorer


People also ask

Where should I put JSON Assetlinks?

The assetlinks. json file is served with content-type application/json . The assetlinks. json file must be accessible over an HTTPS connection, regardless of whether your app's intent filters declare HTTPS as the data scheme.


1 Answers

Associating a website with multiple apps (In answer to "How to create assetlinks.json when website is handled by multiple apps")

https://developer.android.com/training/app-links/verify-site-associations#multi-subdomain

A website can declare associations with multiple apps within the same assetlinks.json file. The following file listing shows an example of a statement file that declares association with two apps, separately, and resides at https://www.example.com/.well-known/assetlinks.json:

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.example.puppies.app",
    "sha256_cert_fingerprints":
    ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
  }
}, {
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.example.monkeys.app",
    "sha256_cert_fingerprints":
    ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
  }
}]
like image 124
Nexus7_2012 Avatar answered Oct 04 '22 00:10

Nexus7_2012