I don't have public web URLs which I can annotate to support App Links, so I use Facebook's Mobile Hosting API for App Links.
According to the app links doc, I can pass the canonical URL ( https: //fb.me/xxxxxxxxxx ) provided by the App Links Hosting API. The canonical URL includes three information, URL、APP Name、Package Name, and the URL is like this:
my_app_scheme://actions?ads_name=1
I try to get the QueryParameter("ads_name") of URL from Android Data to open defined page of app. I use the following code.
AppLinkData.createFromActivity(MainActivity.this);
if (AppLinks.getTargetUrl(intentOtherApp) != null) {
Uri targetUrl = AppLinks.getTargetUrl(intentOtherApp);
if (targetUrl != null) {
Bundle appLinkData = AppLinks.getAppLinkData(getIntent());
if (appLinkData != null) {
String targetURLString = appLinkData.getString("target_url");
Uri targetURL = Uri.parse(targetURLString);
JSONObject jsonObject = new JSONObject();
String adsName = targetURL.getQueryParameter("ads_name");
try {
if (adsName != null) {
jsonObject.put("ads_name", adsName);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
*/
}
}
But I cannot get the data, I always get only the canonical URL. How can I pass my query data from Facebook apps link? And does the app be installed or not be installed using the same method?