0
在我的android應用中,我想讓用戶分享互動帖子。於是我就用給定的代碼https://developers.google.com/+/mobile/android/share/interactive-postGoogle+ api分享互動帖子兩次
PlusShare.Builder builder = new PlusShare.Builder(this, monPlusClient);
builder.addCallToAction("DISCOVER", Uri.parse(target), ident);
builder.setContentUrl(Uri.parse(target));
builder.setContentDeepLinkId(ident, topic.getNomPeintre(), desc,
Uri.parse(topic.getLien()));
builder.setText(texte + " #Art");
Intent shareIntent = builder.getIntent();
startActivityForResult(shareIntent, SHAREGPLUS_REQUEST_CODE);
我有Google+的API(鍵OK)完全operationnal連接。
問題是我可以在Google+中看到我的帖子兩次。
爲什麼?
我的測試環境:
- 的Nexus之下的是Android 4.4.2構建KOT49H
- 谷歌Play服務版本4.1.32(978161-30)
- Android SDK中經理7物理設備:谷歌播放服務版本14
我不確定要理解,如果我不使用setContentUrl,會出現以下錯誤:java.lang.IllegalStateException:交互式帖子需要內容URL。 – bobygerm
是的,如果您需要交互式發佈,那麼請使用setContentUri並且不要使用setContentDeepLinkId()。 Google-plus會從您提供的鏈接中檢索內容,並生成一個交互式文章。 – Prati