I Inhalt teilen bin (wie Text, Bild und App-Link) Book mit folgendem Code:Pass Parameter Book App Link von Android App
Schritt 1:
public void setupFacebookShareIntent() {
ShareDialog shareDialog;
FacebookSdk.sdkInitialize(getApplicationContext());
shareDialog = new ShareDialog(this);
ShareLinkContent linkContent = new ShareLinkContent.Builder()
.setContentTitle(title)
.setContentDescription(
text1+ " " +text2)
.setContentUrl(Uri.parse("http://example/folder"))
.setImageUrl(Uri.parse(path1))
.build();
shareDialog.show(linkContent);
}
hier auch die App Link Metadaten:
Schritt 2:
<html>
<head>
<meta property="al:android:url" content="sharesample://story/1234">
<meta property="al:android:package" content="com.mypackage">
<meta property="al:android:app_name" content="ShareSample">
<meta property="og:title" content="example page title" />
<meta property="og:type" content="website" />
</head>
<body>
</body>
</html>
Und hier der Code eingehenden App-Link in Aktivität zu behandeln:
Schritt 3:
Uri targetUrl = AppLinks.getTargetUrlFromInboundIntent(this, getIntent());
if (targetUrl != null) {
// If you need to access data that you are passing from the meta tag from your website or from opening app you can get them from AppLinkData.
Bundle applinkData = AppLinks.getAppLinkData(getIntent());
String id = applinkData.getString("id");
// You can also get referrer data from AppLinkData
Bundle referrerAppData = applinkData.getBundle("referer_app_link");
} else {
// Not an applink, your existing code goes here.
}
Wie kann ich Daten zu App-Link-URL richtig in Schritt 1, wie einfach passieren String-Parameter und dann zurück in Schritt 3?
niemand eine Idee? :) – Sin