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.

here facebook documentation

facebook (and messenger) doesn't not allow sharing text only.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -