[英]Open Graph Tag for Google+ in Android application
我正在嘗試在Google+上發布Android應用中的網址。 此URL具有OgTags但無法獲取內容,無論是標題,圖像還是描述。
有人有修理的想法嗎?
這是URL的代碼:
<!DOCTYPE html>
<html lang="fr-FR" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#" class="no-js">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="robots" content="noindex,follow"/>
<meta property="og:locale" content="fr_FR" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Test Title" />
<meta property="og:description" content="Test description" />
<meta property="og:url" content="http://www.test.com/test" />
<meta property="og:site_name" content="Test name" />
<meta property="article:published_time" content="2013-11-29T17:09:55+00:00" />
<meta property="article:modified_time" content="2014-05-21T10:05:55+00:00" />
<meta property="og:updated_time" content="2014-05-21T10:05:55+00:00" />
<meta property="og:image" content="test_content.png" />
這是構建請求的代碼:
public GooglePlusHelper(Activity context) {
mActivity = context;
mPlusClient = new PlusClient.Builder(mActivity, this, this)
.setActions("http://schemas.google.com/AddActivity", "http://schemas.google.com/ReviewActivity")
.setScopes("PLUS_LOGIN") // Space separated list of scopes
.build();
}
public void connect() {
mPlusClient.connect();
}
public void disconnect() {
mPlusClient.disconnect();
}
/**
* Open Google+ to share a link
*
* @param message
* @param link
*/
public void shareUrl(String message, String link) {
if (!Tools.hasNetworkConnection(mActivity)) {
AlertHelper.displayInternetRequired(mActivity);
return;
}
Intent shareIntent = new PlusShare.Builder(mActivity)
.setType("text/plain")
.setText(message)
.getIntent();
if (mActivity.getPackageManager().queryIntentActivities(shareIntent, PackageManager.MATCH_DEFAULT_ONLY).size() > 0) {
mActivity.startActivityForResult(shareIntent, SHARE_REQUEST);
} else {
AlertHelper.displayGooglePlusRequired(mActivity, new Runnable() {
@Override
public void run() {
mActivity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(mActivity.getString(R.string.uri_app_market) + "com.google.android.apps.plus")));
}
});
}
}
我稱之為:
mGooglePlusHelper.shareUrl("Go share it !", "http://www.test.com/test");
謝謝
http://www.test.com/test
只是重定向,所以我猜這不是你的實際頁面。 共享的頁面必須在互聯網上公開訪問,以便Google的服務器獲取和解析它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.