Tim Nuwin
Tim Nuwin

Reputation: 2887

Where do I find the namespace of an app [Android]

I need to find the namespace of the app, so I can fill in the value for the assetlinks.json file.

https://www.domain1.com/.well-known/assetlinks.json

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.mycompany.app1",
    "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"]
  }
}]

Upvotes: 32

Views: 6704

Answers (2)

awaik
awaik

Reputation: 12287

Thanks for the @johnw182 answer, just want to add, that wrong name leads to unpredictable errors and I spent a lot of time to find them. But it is possible to validate the assetlinks.json file

Just change YOUR_WEB_SITE_ADDRESS to web-site with assetlinks.json file.

https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://YOUR_WEB_SITE_ADDRESS&relation=delegate_permission/common.handle_all_urls

Upvotes: 8

johnw182
johnw182

Reputation: 1469

Tim, I was looking for this too because the Google docs never explained the namespace field in the json. As it turns out, you leave the value as android_app, this tells consumers these settings are specifically for an android_app. It is not to specify the specific namespace of your app or project (like I also assumed)

See https://firebase.google.com/docs/app-indexing/android/app

Target: Using the namespace value of android_app determines the android app that receives the URLs. Configure it using its package name and the SHA-256 fingerprint of the certificate you used to sign your app before deploying it to the Play Store. See Signing Your Applications to learn more about deployment and your signing certificate.

Upvotes: 56

Related Questions