Google Plus sharing from android app -
i have been trying post on google plus stream since morning, not getting posted contents specified in deeplinkid content inside settext() gets posted. here 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 tested code minimal mainactivity , 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 menu; adds items action bar if 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 sure offrdetails_data.get(0)
contains data?
edit in response comments: may offrdetails_data.get(0).offerlink longer 512 characters.
the limit on deep link ids 512 characters (see description data-calltoactiondeeplinkid):
https://developers.google.com/+/web/share/interactive#interactive_share_button_attributes
Comments
Post a Comment