Android Tutorial Uploading Photo to Facebook

Uploading Photo to Facebook is possible now with B4a and a webview




I modified it to post a photo to facebook.

All you need to do is create a Facebook App

Which will give you a valid client Id and Secret ID:
Dim clientId As String : clientId = "xxx"
Dim clientSecret As String : clientSecret = "xxx"

RedirectUri="http://?????????.com/"
' Make sure you have the trailing / after your .com/

This was in Response to NJDUDE's post.
He is always throwing up tons of samples, so this one is for you!
 

Attachments

  • Android2Facebook.zip
    115.4 KB · Views: 1,521
Last edited:

tdocs2

Well-Known Member
Licensed User
Longtime User
Thank you and help please

Hello, VB1992 and NJDude

Can u help?

My posting is:
http://www.b4x.com/forum/basic4android-updates-questions/24196-facebook-posting-b4a-app.html

I repeat it here:

Please refer to post 101679 posted by NJDude and pointing to VB1992 posting to an actual application sample to post a message to the wall on Facebook. Thank you both for all of your contributions. Brilliant.

http://www.b4x.com/forum/basic...tml#post101679

I used the app written by VB1992 (with credits to Steve05, NJDude and Erel), and I got it to work. The part I struggled with was the creation of the Facebook app (which I managed to do thanks to NJDude posting - 101679). I modified the VB1992 app to use date and time to be able to differentiate multiple postings.

These are the issues/problems which I cannot seem to solve:

1. How postings appear on Wall
The postings from the VB1992 app, appear on the Facebook wall (mine and others) with my Facebook name via my Facebook app name. I would like only my Facebook app name to appear and not my Facebook name.

2. Permission from User to post
I tried to post to other Facebook users (by first logging out my name and then logging in under their name in the android tablets I use for testing) who did not have me as a "friend" nor my Facebook app authorized and the VB1992 app indicates that the message was posted when it should have asked for authorization... The message was not posted to the intended account, but instead, the messages were posted to my member account.

Help please.

Thank you.
 

NJDude

Expert
Licensed User
Longtime User
First of all, no need to repeat posts, just bump it, that way we avoid unnecessary duplicates.

These are the issues/problems which I cannot seem to solve:

1. How postings appear on Wall
The postings from the VB1992 app, appear on the Facebook wall (mine and others) with my Facebook name via my Facebook app name. I would like only my Facebook app name to appear and not my Facebook name.

I don't know if that's possible, the code uses Facebook's API, so, it's up to them to control it, besides, they keep changing their terms of service and features, so, who knows if that's allowed or not.

2. Permission from User to post
I tried to post to other Facebook users (by first logging out my name and then logging in under their name in the android tablets I use for testing) who did not have me as a "friend" nor my Facebook app authorized and the VB1992 app indicates that the message was posted when it should have asked for authorization... The message was not posted to the intended account, but instead, the messages were posted to my member account.
I wrote that code specifically to post to your own wall, also, logging out doesn't really log you out, you will have to clear the cookies and cache, I even mentioned that at the bottom of the tutorial.
 

tdocs2

Well-Known Member
Licensed User
Longtime User
Thank you

Thank you for your reply.

I have been trying to look for a solution to this issue, but to no avail.

Facebook seems to attach the app to the developer. And when the app posts, it shows the developers name.

The real need is what I described. If you build a real B4A app and as a feature, you want the user to post to Facebook (I believe in one of the postings in VB1992, someone wanted to post a score - I presume a game), you would not want the posting to be from the developer via the app. You would want the posting to be either from the app itself or from the user via the app.

FYI only: I created two additional Facebook accounts - one for a brand and a second one for a company and neither is able to own an app... (this would have solved the problem).

On my tablets, I went to the Facebook page and actually logged out the account. I turned off the tablet. That does not clear the cache? How do you clean the cache?

Very best regards.

Sandy

PS By a bump, you mean the link to the original posting?
 

Creaky

Member
Licensed User
Longtime User
I wrote that code specifically to post to your own wall, also, logging out doesn't really log you out, you will have to clear the cookies and cache, I even mentioned that at the bottom of the tutorial.

Where do I need to clear the cache and the cookies? In the default Android browser?
 
Top