checkAppLinksServerSetup
Checks that the server setup for the Android app links is valid for the app instance that uses multipaz library.
Important: this function does not determine if app links should be trusted or not (that is done independently in Android OS). Instead, it attempts to evaluate if Android is going to trust the way the server set up and if the answer is no, helps to diagnose and fix the problem.
Server setup might no work for various reasons:
app was configured to use a server that simply lacks any setup
assetlinks.json
is not formatted correctlyapp was signed by a key that is not known to the server
This function attempts to validate the setup. If it is valid it returns true
. If it is invalid, it prints to a log a sample assetlinks.json
that would be acceptable and returns false
.
If the server is unreachable, setup is not validated and assumed valid, true
is returned. This is to avoid flagging errors when offline. Also no validation happens below Android "P" release.
Note that correct intent filter for the app links must also be specified in the application's AndroidManifest.xml
. It is not possible to verify this part at runtime.
Parameters
application or Activity context
server URL, e.g, "https://example.com" without trailing slash.
HTTP client to use for fetching assetlinks.json