Create a facebook application programmatically - facebook

I'm trying to programmatically create an application in Facebook. I can do that with this:
https://www.facebook.com/connect/create_app.php?api_key=[key]&name=app_name
However, there's always a popup that says "Allow [Root App] to integrate Facebook functionality for you?" ... OK.
Is it possible for the "Root App" to create the application on the user's behalf without the popup via some previous permission which they have allowed, like stream_publish ...etc or maybe a session_token or ??
Someone said I can create child apps via "admin.setAppProperties" but couldn't get it working. I've also tried "FB.Connect.createApplication" and "Facebook.createApplication" but also failed.
Can anyone help? Maybe with some sample code.

There used to be an API for this but I think it has been discontinued. You can see if you can hack it together from the information available here:
http://blog.programmableweb.com/2009/10/15/facebook-lets-you-easily-integrate-into-sites-and-widgets-with-new-create-application-api/

Child applications (I believe they called them 'fourth party applications') intentionally need user interactions to create.

The documentation for https://www.facebook.com/connect/create_app.php?api_key=[key]&name=app_name is scarce to none. Are you able to access the API key of the newly created application somehow? Or set further app settings such as site-url?
I'm thinking you would need the user's permission to view /accounts then monitor before/after state to detect which one was created.

Is it possible for the "Root App" to create the application on the
user's behalf without the popup via some previous permission which
they have allowed, like stream_publish ...etc or maybe a session_token
or ??
If you create a Facebook application that only pulls someone's profile information, and then you add new functionality that allows it to automatically post on people's walls; you would have to require the user to re-authenticate themselves to give you those extra permissions.
It's hard to understand what you meant by that question.

Related

Facebook: detecting user apps

Hello I've read the docs and am having trouble getting a definitive answer for the following questions:
Can our app detect if another app is used by a given user. What about if we are admin of, or have the id of both apps.
If one of the apps is removed from FB is there a way to tell if a user had it installed before it was removed? A sort of history of past apps, I guess.
Here:
FB Connect: is there a way to see the logged in user's facebook apps?
Best answer is "I think the most you can do..." but I'd like to know for sure.
Thanks for any help.
If you request the permission user_actions:APP_NAMESPACE you can see the open graph actions that the user has performed in that app.
http://developers.facebook.com/docs/authentication/permissions/#open_graph_perms
In my apps I generally store the user ID of all authorized users in a database, and when I get a call via the "Deauthorize Callback URL" I don't delete the user from the database, but instead only flag the user as deauthorized.
This way I can easily get an overview of users that are using (or have used) any of my apps. This allows me to present special features for users who are using several of my apps.
For example, let's say I made a photo app (like Instagram) and a GPS running app (like Endomondo). If the user takes a photo with Instagram while running with Endomondo, I could present the option to GPS-tag the photo, or add the photo to Endomondo.
This is something that I think we developers should use more. Perhaps present an open API to other apps, to let the apps work together.

Displaying MY public wall using AS3 without user login

I've been trying to get this to work for a while, but I've apparently missed something.
All I want is to have the latest 3 or so posts from my clients Facebook page to populate and animate in a screensaver that I am building using Flash (AS3).
So far, every time I try to bring anything in, it requires a complete oAuth login and account link, but it's only a one way exchange (read-only, absolutely no writing, posting or even linking, since it's a screensaver) I'm not even sure the client wants pictures or anything.
I am currently trying to use the facebook-actionscript-api, but there isn't an option for the "App Login" type of Authentication that would solve most of my problems.
I'm at wits end and about to have to tell my client it can't be done. At least they'll always have twitter...
I don't think it is possible to get facebook feeds without an accesstoken (even if they are public). So I guess you need to define an app within Facebook and add login stuff to your app so users can give permission to your app for basic access.
Maybe this article offers some help: http://www.adobe.com/devnet/facebook/articles/flex_fbgraph_pt1.html

How to register a Facebook Application dynamically via Graph API like wildfireapp and others doing?

I am trying to create a sweepstakes application.
I am trying to copy wildfire.
But I am unable to create facebook applications dynamically like they are doing.
I checked it they are using graph api to show on front end but there is no method available in graph api to create applications dynamically.
Can anyone please guide me how wildfire is doing dynamic app creation. Is there any alternative available?
In general, they are likely not creating new applications for each client. Unless you can show us evidence of this, it is the same application being installed many times onto their client's Facebook Pages.
The application script can detect the Page ID and change the display logic appropriately. Seen here:
Get Facebook fan page ID
If you really want to create applications for your clients, take a look at this thread:
http://facebook.stackoverflow.com/questions/6264080/create-a-facebook-application-programmatically
EDIT (Not being able to comment is horrible) in response to J's post:
There is not a way to create applications entirely programmatically, but you can get really close creating a user-flow around:
https://www.facebook.com/connect/create_app.php?api_key=[key]&name=app_name
Where [key] is the api_key of the parent application. It isn't documented anywhere so you should have a manual fall back in place. The link above does work to create a new Facebook application tied to the currently logged in user (the parent api_key does not seem to have any effect but it is required).
To determine the api_key of the application created, ask the user for the appropriate permission and query /accounts to retrieve a list of Facebook applications the user owns. Do this before and after the user clicks the above link to determine which one was just created. From there, have the user get a new access_token and get the appropriate permissions to modify application settings. You should then customize the newly created application.
Mike
This has been mentioned several times in the old Facebook forum.
Wildfire, North Social et al, do not create applications dynamically. It's the same application being installed by many clients.
How is this possible? Well, when a Page loads a tab application, Facebook pass you a signed_request parameter. When you decode this signed request with your application's id and secret, you will find inside the page id from where the tab application is being called. You can then use this to work out which of your clients is making the call to your code and therefore what content to deliver to the browser.
There have been changes to the Graph API recently to allow you to manage applications once created but you cannot (and likely will never be able to) create applications programmatically through the Graph API.
The second thread mentioned by Mike mentions child applications but this was deprecated from the Facebook code base some time ago and would not actually allow the creation of applications in the way I assume you want.
J

Is it possible to enforce initial configuration of a page app?

I'm attempting to develop my first Facebook app that is designed to allow clients of our website to sell tickets to their events from their Facebook page as well as from our website. So when the administrator of a Facebook page adds our app as a page tab, I need to be able to find out who they are so I can load the relevant event data. There also needs to be additional include/exclude configurations and various other options, which will affect the behaviour of the app.
So my question is how is this situation best handled? When playing around with a basic sandboxed app, I seem to be able to just add the app directly to a page; there is no prompt for configuration, and I can't see any way of defining custom properties.
Is the 'edit_url' property the only way to achieve this? If so, is there a way of automatically directing the page admin to this link upon initial use?
Decoding the signed request recieved in your page will give you more insight.
From this you can retrieve page admins' UID's.
You'll need to manage the rest on your side...
In order to get the user id the user will have to grant your application basic permissions.
I'm currently doing a somewhat similar app and, just like Lix said, I used the signed_request variable to detect the page where the tab is installed. Then, based on the page's ID, I retrieve the proper content.
To also give your users an admin page, add a Page Tab Edit URL in your app configuration where you can redirect your users to a custom panel where they can edit their app.

How do I create a template in facebook?

I cannot find the "create feed template" option on my applications page.
Do I need to authorize my application? I didnt do that yet and am able to allow the user to login and allow permissions etc.
I havent submitted my application as it says the app needs 5 people or 10 monthly users, I just created it and my iphone app isnt out yet?
If I get to the Test console on facebook I dont see my app in the drop down menu? I dont even see a drop down menu.
How Do I create a template? Did facebook change the layout again :P making these tutorials off point?
Yea there's no such thing as templates anymore, you just pass the content as part of the api call.
Start here: http://developers.facebook.com/docs/reference/rest/stream.publish