Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
pravipravi
Posts: 38
Registered: ‎06-03-2009
My Device: 9800
Accepted Solution

Posting a message to my face book account through application

Hi does anybody know how to connect to Facebook through application ?

 

I have Facebook SDK downloaded here.

 

I don't know how to start .

 

Thanks in advance..

 

Praveen K

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Posting a message to my face book account through application

maybe check the sample application available on the facebook sdk page? called strawberry i think
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
pravipravi
Posts: 38
Registered: ‎06-03-2009
My Device: 9800

Re: Posting a message to my face book account through application

simon, I could nt find a link to strawberry ... And I have some sample app with me . But seems not working with.
Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Posting a message to my face book account through application

http://facebook-bb-sdk.svn.sourceforge.net/viewvc/facebook-bb-sdk/trunk/src/samples/strawberry/
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
pravipravi
Posts: 38
Registered: ‎06-03-2009
My Device: 9800

Re: Posting a message to my face book account through application

Thanks Simon !! This one helps me lot!!
Developer
pravipravi
Posts: 38
Registered: ‎06-03-2009
My Device: 9800

Re: Posting a message to my face book account through application

Here is my code. While calling publishPost I am getting

 

"facebook.FacebookException: Unable to refresh the Access Token".What does this mean?

 

public void run() 
	{
		try 
		{
			ApplicationSettings appSettings = new ApplicationSettings(GLStringConstants.FACEBOOK_LOGINURL, GLStringConstants.FACEBOOK_APPKEY, GLStringConstants.FACEBOOK_SECRET, GLStringConstants.FACEBOOK_PERMISSIONS);
			Facebook faceBook = Facebook.getInstance(appSettings);
			
			String publishPostresult = null;
			User user = faceBook.getCurrentUser();
			if(user != null)
			{
				publishPostresult = user.publishPost(_message, _link, _picture, _name, _caption, _description, _source);
				user.publishStatus("Hello BlackBerry!"); // this does not publish my status update. boo
			}
			
			if ((publishPostresult != null) && !publishPostresult.trim().equals("")) 
			{
				Dialog.inform("Publish Post Success.");
			}
			else 
			{
				Dialog.inform("Publish Post Failed.");
			}
		}
		catch (FacebookException e) 
		{
			e.printStackTrace();
		}
	}

 Thaks

Praveen K