sendmessage - Android. Send text to facebook messenger by Facebook SDK 4.X -
as document facebook, can send image android app facebook messenger below.
string metadata = "{ \"image\" : \"trees\" }"; sharetomessengerparams sharetomessengerparams = sharetomessengerparams.newbuilder(contenturi, "image/jpeg") .setmetadata(metadata) .build(); // sharing activity messengerutils.sharetomessenger(this, 0, sharetomessengerparams);
but want send text. tried below.
sharetomessengerparams sharetomessengerparams = sharetomessengerparams.newbuilder(null, "text/plain") .setmetadata("text send") .build(); // sharing activity messengerutils.sharetomessenger(this, 0, sharetomessengerparams);
when tested this, java.lang.nullpointerexception: must provide non-null uri exception occurs.
how can send message facebook messenger..? using intent not available now, need use facebook sdk 4.x.
facebook (and messenger) doesn't not allow sharing text only.
Comments
Post a Comment