Facebook Desktop Application using restfb and netbeans - facebook

I am developing a desktop fb app like yoono.
For windows, user can open the application and update his status and read the feeds.
For this I am required to have app id.
Therefore I created a new Facebook app in link https://developers.facebook.com/apps.
But I don't understand how to integrate that Facebook app so that it works like desktop app.
I mean the code is written in my computer program not in any site etc.
Please tell me what what I do since I didn't own any website either therefore I cant provide any canvas url.

There is a setting for desktop apps in the advanced tab. Make sure it is set to Native/Desktop.
The graph API is a web API. You send a HTML POST request to a URL and receive a JSON string that you have to decode. What's a bit more complicated is authentication. Because you will need a user access token to query a user's friends list or personal details. Even the user's ID.
Search on the web for a Facebook API wrapper in your programming language of choice. The ones provided by facebook are obsolete (Except for the PHP one).

Related

VK API, access denied for post on wall of a community, fail WALL Permissions

I build API for post on my community of VK. But I check my permission for my app, and I have all permissions, but not load WALL permissions.
In the scope for OAuth, I put all scopes and not work the WALL. I check the "Api.console" and they have "Access to Wall - The application has access to your wall", but in my app not appear.
This is the response:
{"error":{"error_code":15,"error_msg":"Access denied: no access to call this method","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"wall.post"},{"key":"owner_id","value":"-*********"},{"key":"from_group","value":"1"},{"key":"message","value":"New post on group wall via API."}]}}
I check other services and if work.
You can't call wall.post (and a lot of other methods) with a non-standalone applications. It seems like your VK application is of type Website or iFrame - they have limited access to the API methods.
However, while you can't call this method from non-standalone applications, can via the Open API (it's a JavaScript SDK for Website applications) or the JavaScript SDK for iFrame applications.
When you call wall.post via these SDKs, a confirmation window will appear where the user needs to confirm the wall post before sending it:
Standalone applications are designed to be used in apps like mobile or desktop clients or browser extensions (because they don't have CORS limitations and may read any tab). There is absolutely no ways to get a user's standalone access token without limitations if you are trying to authorize them via website.
If you are building website or something and need wall.post for service purposes (e.g. news cross-posting), then you may get your token and save it anywhere in site configuration. Open this address:
https://oauth.vk.com/authorize?client_id={APP_ID}&scope={PERMISSIONS}&v={ACTUAL_API_VERSION}&response_type=token&redirect_uri=https://oauth.vk.com/blank.html
{APP_ID} - your standalone application ID (may be found in application Settings).
{PERMISSIONS} - comma-separated list of permissions. Don't forget the offline permission to get token that doesn't expire.
{ACTUAL_API_VERSION} - VK API version.
Example:
https://oauth.vk.com/authorize?client_id=123456&scope=wall,offline&v=5.60&response_type=token&redirect_uri=https://oauth.vk.com/blank.html
Note that redirect_uri=https://oauth.vk.com/blank.html is required to get token without the above mentioned limitations.
After you grand your application access to your account, access token without limitations will appear in your browser address bar. Just copy it, save in your configs and feel free to call any methods you want.
Late but...for this you need to first create a sort of "demo" app for VK using the standalone app type which would issue you an access token inside the address bar when you set the redirect link to https://oauth.vk.com/blank.html
This access token would allow you to share to your personal profile wall.
Then you need to contact VK support and display your app in action. Once they approve it then you'd be able to use a "Website" app that has OAuth style authentication

Facebook Graph API - Publicly access Pages info

I have a JavaScript script that fetches data of a Facebook Page URL and puts it in a form. It works perfectly as long as I am connected to my Facebook Developer Account, and that I use the corresponding App ID.
My question is: can I make this public? Without need to be connected to my Facebook account? I want users on my website to be able to use this feature but I can't figure this out, and I'm now wondering if it's even possible.
This concerns Pages specifically (not Events).
You either have to make users login to your app (so that you can use their access token to request the data),
or you need to move it to the server side, so that you can use either an app or a page access token (both of those should never be exposed in client-side code.)

Facebook Mobile App identify installed user

I have a Facebook App where it can be installed on a users page and then their clients can make bookings with them. As such, the app needs to know who installed the app on their Page, not so much who is currently using it.
I can do this on the web app using signed_request and Page Id. Signed request is not available on Mobile Facebook apps though. Is there any other way of identifying the installed user?
No, in order to get the user's information you'll need them to Login to the app and give you permission to see their data; the workaround you're using elsewhere with the signed_request doesn't apply, because that's specific to page tab apps, and only gives you the 'like' status, not the user ID

Website and a facebook mobile app - do they need to be separate?

The existing website uses Facebook OAuth for login. The plan is that soon that certain events on the site will be posted to the user's timeline. The "userA watched xxx" kind of thing.
We're also at the stage of starting an iPhone app to connect to the website's data API. If the user has authenticated to the website with the mobile app using the facebook login:
would the mobile app need access to the Facebook oauth keys? I'm guess not, as the user would do something, and the website would have the credentials stored to post to facebook, but I'm not sure.
would there in fact be 2 apps, one that is facebook based and one that is not?
Apologies if this is really basic information I'm asking, but I've not developed Facebook apps previously and the information I look at isn't always clear.
In my apps, I code two authentication flows, one for facebook users, and one for users without facebook (this is the typical, create your account, and subsequently login with your username and password). So one app, two login flows.
Regarding the app accessing the Facebook oauth keys, if you are coding with the Facebook iOS SDK, you won't even need to worry about the oauth key itself, as it's totally encapsulated by the SDK. You'll simply invoke methods to trigger authentication, and then once the user is authenticated, you can call other methods to invoke certain aspects of SDK/API.
The Facebook iOS SDK supports all the functionality you'll need to make the posts directly from the app itself. You won't need to make an API call to your server, to then make a second call to the Facebook API. Just handle all that from the app directly. So if your app does depend on a successful API call to your server, prior to posting to Facebook, make that API call, wait for the response (that either includes additional data, or a success:true flag), and then make the post to the Facebook via the Facebook iOS SDK.
The Facebook iOS SDK docs are AWESOME these days, and the code samples are even better. Check them out at:
http://developers.facebook.com/ios/

how to get the user list those who are access my facebook application through my iphone apps

i am creating an iphone apps which need to use facebook login details to enter into the apps as Groupon iphone apps.
In Groupon, they are using FBConnect to access their facebook application, based on the login success they are allowing me to access their deals.
I had used FBConnect package to post some message to user's wall using my own facebook application API. But not clear as how to use facebook login details to enter into my apps as in groupon.
my questions as follow,
Is there any way to access the user details who are used registered to access my iphone apps which using my facebook application API?
Advanced Thanks!
Check the readme file shown beneath the source directories at http://github.com/facebook/facebook-iphone-sdk
It sounds like you're talking about two things.
First, you want your app to get extended permission from your user so you can access their specific information.
Second, you want to query Facebook for that information once you have permission. You can do that by making specific Facebook API calls once you have permission.