I'm trying to set up an assetlinks.json file on my web server to indicate that deep links should be handled by the mobile app and that login credentials should be shared between the website and mobile device on Android 8.
I have the assetlinks.json file hosted on my dev server (https://devtesting.narrpr.com/.well-known/assetlinks.json).
[{
"relation": ["delegate_permission/common.get_login_creds"],
"target": {
"namespace": "web",
"site": "https://devtesting.narrpr.com/"
}
},
{
"relation": ["delegate_permission/common.get_login_creds", "delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.rpr.mobile",
"sha256_cert_fingerprints": [
"D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21"
]
}
}
]
When I execute this url to test it, it gives an error:
{
"maxAge": "599.999999890s",
"debugString": "********************* ERRORS *********************\n* Error: invalid_argument: Could not parse statement list (not valid JSON): \\357\\273\\277[{\\r\\n\\t\\t\\\"relation\\\": [\\\"delegate_permission/common.get_login_creds\\\"],\\r\\n\\t\\t\\\"target\\\": {\\r\\n\\t\\t\\t\\\"namespace\\\": \\\"web\\\",\\r\\n\\t\\t\\t\\\"site\\\": \\\"https://devtesting.narrpr.com/\\\"\\r\\n\\t\\t}\\r\\n\\t},\\r\\n\\t{\\r\\n\\t\\t\\\"relation\\\": [\\\"delegate_permission/common.get_login_creds\\\", \\\"delegate_permission/common.handle_all_urls\\\"],\\r\\n\\t\\t\\t\\\"target\\\": {\\r\\n\\t\\t\\t\\t\\\"namespace\\\": \\\"droid\\\",\\r\\n\\t\\t\\t\\t\\\"package_name\\\": \\\"com.rpr.mobile\\\",\\r\\n\\t\\t\\t\\t\\\"sha256_cert_fingerprints\\\": [\\r\\n\\t\\t\\t\\t\\t\\\"D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21\\\"\\r\\n\\t\\t\\t\\t]\\r\\n\\t\\t\\t}\\r\\n\\t}\\r\\n] [0] while fetching Web statements from https://devtesting.narrpr.com./.well-known/assetlinks.json (which is equivalent to 'https://devtesting.narrpr.com/.well-known/assetlinks.json') using download from the web (ID 1).\n********************* INFO MESSAGES *********************\n* Info: No statements were found that match your query\n",
"errorCode": [
"ERROR_CODE_MALFORMED_CONTENT"
]
}
In the debug line it says that it's not valid json, however jsonlint begs to differ. Any idea what I'm doing wrong?
After generating the assetlinks.json file through Android Studio (instead of manually), it started working. Not sure if I missed content or if it was an issue with windows text encoding.
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.rpr.mobile",
"sha256_cert_fingerprints":
["D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21"]
}
},
{
"relation": ["delegate_permission/common.get_login_creds"],
"target": {
"namespace": "web",
"site": "https://devtesting.narrpr.com"
}
},
{
"relation": ["delegate_permission/common.get_login_creds"],
"target": {
"namespace": "android_app",
"package_name": "com.rpr.mobile",
"sha256_cert_fingerprints":
["D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21"]
}
}]