I have been trying to post on google plus stream since morning, but it does not getting posted all contents specified in deeplinkid only the content inside setText() gets posted. here is my code,
Intent shareIntent = new PlusShare.Builder(this)
.setText("Hello Android!")
.setType("image/png")
.setContentDeepLinkId(offrdetails_data.get(0).offerLink,
offrdetails_data.get(0).dealTitle,
offrdetails_data.get(0).dealDescription,
Uri.parse(offrdetails_data.get(0).dealImage))
.getIntent();
startActivityForResult(shareIntent, 0);
I just tested your code with a minimal MainActivity and it worked:
public class MainActivity extends Activity implements View.OnClickListener {
private Button mButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mButton = (Button) findViewById(R.id.button1);
mButton.setOnClickListener(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public void onClick(View v) {
Intent shareIntent = new PlusShare.Builder(this)
.setText("Hello Android!")
.setType("image/png")
.setContentDeepLinkId("testID",
"Test Title",
"Test Description",
Uri.parse("https://developers.google.com/+/images/interactive-post-android.png"))
.getIntent();
startActivityForResult(shareIntent, 0);
}
}
Are you sure that offrdetails_data.get(0)
actually contains data?
Edit in response to comments: It may be that offrdetails_data.get(0).offerLink is longer than 512 characters.
The limit on deep link IDs is 512 characters (see description for data-calltoactiondeeplinkid):
https://developers.google.com/+/web/share/interactive#interactive_share_button_attributes