Getting error application already exists

Sep 5, 2007 at 4:11 PM
Edited Sep 5, 2007 at 4:43 PM
when running the sample It keeps telling my the application is alreadyy added
Coordinator
Sep 10, 2007 at 6:20 PM
And is the app in fact added? You can't add an app multiple times...
Sep 10, 2007 at 8:16 PM

NikhilK wrote:
And is the app in fact added? You can't add an app multiple times...


No, this is the first time.
Sep 26, 2007 at 4:02 AM
I can confirm that at various points, such as when I click the sidebar link to the application that Facebook.NET keeps redirecting to the facebook add.php page, netting me this annoying screen.

What's going on?
Coordinator
Sep 26, 2007 at 5:43 AM
BinaryJay... providing specific repro steps will help isolate the problem... just this description doesn't help get to the bottom of the problem.
Sep 27, 2007 at 8:38 AM
Make sure you are using the <fb:FacebookHyperlink> tag and not the <asp:HyperLink> tag.

Sep 30, 2007 at 10:18 AM
Edited Sep 30, 2007 at 10:24 AM
I had the same issue; the cause was that Facebook was not posting back the fb_sig_added field during the redirect. This has been briefly discussed in the Facebook Developers Wiki (Bug 107) see http://wiki.developers.facebook.com/index.php/Your_callback_page_and_you.

To resolve this I have the session examine the user instead of relying on Facebook to send the info. This was done by replacing

if ((redirectUrl == null) && (Application.IsApplicationAdded == false)) {
redirectUrl = String.Format(FacebookAddAppUrl, ApplicationKey);
}

with

if ((redirectUrl == null))
{
Facebook.Service.FacebookService fbService = new Facebook.Service.FacebookService(this);
Facebook.Service.User user = fbService.Users.GetUser(null, "has_added_app");

if ((user.HasAddedApp == false))
{
redirectUrl = String.Format(FacebookAddAppUrl, ApplicationKey);
}
}

For both the IFrame and FBML sessions (which ever you are using). I also updated the FacebookApplication.IsApplicationAdded to do something similar so long as the session has been created.

If this is the normal behaviour of new Facebook applications then the FacebookNET API will need to be changed to implement both scenarios.

Hope this helps!

Kingsley
Oct 2, 2007 at 6:01 PM
Edited Oct 2, 2007 at 7:27 PM
Kingsley,

Where does this go -- in the page load event of every page?

Also, I don't even seem to have a "HasAddedApp" property on my user object. I double-checked and I have 0.2.1 binaries...
Oct 3, 2007 at 11:55 AM
Edited Oct 3, 2007 at 11:55 AM

bonder wrote:
Kingsley,

Where does this go -- in the page load event of every page?


No, look for the

if ((redirectUrl == null) && (Application.IsApplicationAdded == false)) {
redirectUrl = String.Format(FacebookAddAppUrl, ApplicationKey);
}

block in the FacebookFbmlSession.cs and FacebookIFrameSession.cs files and replace it with the code I provided.


Also, I don't even seem to have a "HasAddedApp" property on my user object. I double-checked and I have 0.2.1 binaries...


It is there for sure. See http://www.codeplex.com/FacebookNET/SourceControl/FileView.aspx?itemId=20409&changeSetId=7480 and you will see it in there. Make sure you are looking at the correct object, you may be looking at the IIdentity object inside your page. Make sure it is of type Facebook.Service.User.

Kingsley
Oct 4, 2007 at 4:19 AM
Stupid question - but what about external applications that can't be added? Is there any way to detect that it can't be added and not redirect to add.php? If this isn't something we can detect programmatically, can there at least be a property to disable the attempt to add?

Or am I just missing something obvious? (which is likely)