android


Post to Facebook wall without using ShareDialog in Facebook 4.+


I am working on an app that I want to be able to post to Facebook wall. The language used for the app is non-latin based character set. Hence, the user types the content to share using the app itself and then share it on facebook without going to the ShareDialog as the content is already typed. I am using Facebook SDK for Android 4.+. Can anyone help me on doing this? All example I got is posting using ShareDialog. Facebook SDK seems to have classes like ShareLinkContent, SharePhoto, ShareMedia but no class to attach simple text content which I am trying to do. Or, can I make the content already typed appear on the ShareDialog's EditText?
Facebook does not allow you to pre-fill the ShareDialog's text. As far as I know there also is no other way to post content on a user's wall.
What is possible is share a link using the ShareDialog, and you can pre-fill the link description and other attributes like image and title but I guess that's not what you want.
An example of that is:
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentDescription(descriptionString)
.setContentUrl(Uri.parse(urlString))
.setImageUrl(Uri.parse(pictureUrlString))
.setContentTitle(titleString)
.build();
ShareDialog dialog = new ShareDialog(this);
dialog.show(content);
private void showFacebookShareDialog() {
if (ShareDialog.canShow(ShareLinkContent.class)) {
ShareLinkContent linkContent = new ShareLinkContent.Builder()
.setContentTitle("Title")
.setContentDescription(
"Share Text")
.setContentUrl(Uri.parse("http://developers.facebook.com/android"))
.build();
shareDialog.show(linkContent);
}
}

Related Links

Sound is not coming out while implementing Text-to-speech in Android activity
I use iOS LightBlue to connect Android simulator peripheral, and the iPhone shows that timeout interrogating the peripheral
Repeat notification after time
Requesting permissions in Android 6.0 (API level 23)
Android: Navigation Drawer. After log in, username will appear
Register to firebase notifications before app is launched
Why InSampleSize needs to be a power of 2?
Play video in Activity with sliding up layouts
GCM Push notification when app is killed Android Pre lollipop
React-native : Compiling Android error on processReleaseResources step
Blurred images in iOS and Android in Xamarin Forms PCL
Android lean back mode
Getting error when try to import picasso library
use of different ImageViews makes scrolling not smooth
How to use Google Sign Up button?
Data exchange between two users using Firebase

Categories

HOME
xml
turing-machines
merge
wakanda
zend-framework
sublimetext
rendering
static-site
3d-reconstruction
ado.net
opengl-3
p2p
jquery-ui-sortable
dkim
reactive-programming
github-enterprise
pega
spring-social
magnetic-cards
video-editing
asp.net-mvc-viewmodel
html5-appcache
google-container-registry
swagger-2.0
solrcloud
parcelable
imageresizer
xunit
google-cloud-print
fat
syntax-highlighting
testbed
erb
clickjacking
sql-delete
yowsup
ideascript
sessionstorage
opensmpp
news
signals-slots
globalize
rserve
reindex
scalding
subnet
backbone-collections
type-theory
lsyncd
mouseleave
template-toolkit
trigger.io
gameplay-kit
choice
flex4.6
burrows-wheeler-transform
uicolor
hclust
scaffolding
tooleap
aspen
inf
microsoft-reporting
xvim
viola-jones
uncompress
liquid-layout
airbrake
dbaccess
nsmenu
create.js
with-statement
template-deduction
verold
functional-java
winginx
mutual-authentication
paste
radiant
extjs2
multiautocompletetextview
rfc5322
dolby-audio-api
android-icons
windows-98
veracity
faye
adobe-media-server
listitem
apache-commons-dbutils
landscape-portrait
strsep
diagrams
ruby-1.8
resharper-6.0
zend-rest
echo3
build-environment
application-planning
unmanagedresources
soappy
change-management

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App