2

次のコードを使用して、Android アプリの Google プラスで投稿を共有しました。しかし、スニペットの説明が表示されません.説明以外のすべてが表示されます.これには何か理由がありますか?

Intent shareIntent = new PlusShare.Builder(this)
            .setText("Test")
            .setType("text/plain")
            .setContentDeepLinkId(
                    "Example",  /** Deep-link identifier */
                    "Snippet",  /** Snippet title */

     // ------------ Below Desciption is not visible in post --------------

                    "Good Example", /** Snippet description */

                    Uri.parse("https://www.example.com/snippet.png"))
            .getIntent();
    startActivityForResult(shareIntent, POST_ON_GOOGLE_PLUS);

どんな助けでも大歓迎です。

4

1 に答える 1

1

の下のGoogle API コンソールでディープ リンクが有効になっていることを確認しますClient ID for installed applications

Android クライアントで有効になっている場合は、ドキュメントのサンプル コードが機能するかどうかを試してみてください。テストしたところ、うまく機能します。

    PlusShare.Builder builder = new PlusShare.Builder(this, mPlusClient)
    .setText("Lemon Cheesecake recipe")
    .setType("text/plain")
    .setContentDeepLinkId("/cheesecake/lemon", /** Deep-link identifier */
            "Lemon Cheesecake recipe", /** Snippet title */
            "A tasty recipe for making lemon cheesecake.", /** Snippet description */
            Uri.parse("http://example.com/static/lemon_cheesecake.png"))
     .getIntent();

注意事項:

  • PlusShare.Builder(this)無許可のクライアントを使用し、通常の共有にフォールバックします。

クライアントを渡さない場合、以下は機能しません。

  • 受信者の事前入力
  • スニペットの指定
  • コールトゥアクションボタンの設定

これが、インタラクティブな投稿が正しく表示されない理由だと思います。承認済みの API クライアントを渡すようにしてください。

于 2013-08-17T01:46:12.407 に答える