web metrics
Technoeuphoria!

SOLVED: Facebook Application showing as not found

I have been mulling over this problem for a few months now. For some reason, I experience getting this message

The page you requested was not found.
You may have clicked an expired link or mistyped the address. Some web addresses are case sensitive. I mentioned this in a few of my previous posts

whenever I try to access my Facebook applications when I am logged out. But when I log in to Facebook first THEN access the URL, I am able to resolve the application. Apparently, I wasn’t the only one experiencing the problem http://forum.developers.facebook.com/viewtopic.php?pid=96845#p96845 First reported in January this year and until now this issue has not been closed.

 

THE FIX:

1. Edit the settings of your application –> Enable Developer Mode –> save


image   
Wax On…

image
SAVE!

 

2. Edit the settings of your application –> Disable Developer Mode –> save

image 
Wax Off…

image
SAVE!!

3. log out and try to access your Applications URL

 

This worked for all the apps I was having issues with so I hope it works for the rest of you guys too. A few people were reporting how the application would resolve in their dev sites but then would cease to work once they ported them over to their Test sites. Highly likely, once the developers have the application and deploy it into a test scenario, they don’t bother going into “Developer Mode” before spreading the application which is probably why they are experiencing this. I hope they fix this soon. I’m relieved that my apps work fine now…

Posted by jocelyn | with no comments
Filed under: ,

Using the Facebook Developer Toolkit 2.0 for Canvas Based applications

I missed the release of the latest version of the Facebook Developer Toolkit from clarity consulting so I decided to play around with it after our Mix It Up event.

There have been much changes to the toolkit since the last time I looked into it. It took me a few minutes to try to figure out how to get a simple application out. The documentation posted here is a bit outdated so let me post my own little how-to. They’ve actually made it a lot easier but the new API needs a bit of getting used to I guess. It’s a bit confusing as the APIs for CanvasFBMLBasePage is different from CanvasIFrameBasePage. I hope they standardize soon though. Considering that this is supposedly an RC, it doesn’t seem like they’ve settled on a convention yet.

So again, assumption is:

1. You’re using C# as your language

2. You’re building an app with the CanvasFBMLBasePage (haven’t tried out the Master Page yet.. baby steps my friend)

1. Visit http://www.facebook.com/developers and Setup A New Application. Expand the optional fields and set up your application, making sure you have the following details filled in:

image

image

image

2. Once you have successfully set this up, take note of your API Key and Secret:

image

3. Fire up Visual Studio 2008 and set up a new ASP.NET Web Application

4. Open up Default.aspx and remove everything but the first line (which is the page directive that says tells .NET which is the CodeFile. Your default.aspx should look something like this:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:label ID="Content" runat="server" text="Label"></asp:label>

// For convenience, I added an asp.net label control where I would write out the FBML later on. If you’d rather use Response.Write() you could do that as well. Then you wouldn’t need to have the second line on Default.aspx

5. Before we dig into the CS files, we’ll need to add a reference to the facebook dlls that we can download from codeplex. Simply select to download bin.zip and it should give you the dlls necessary for you to build a Facebook app. Unzip this in a location you can easily find. Go to your Solution Explorer and right-click on your project –> Add Reference

image

Click on the Browse tab and navigate to where you extracted the binaries for the toolkit. You will want to add a reference to both facebook.dll and facebook.web.dll //yes, the non-caps irks me too.. wait till you see the classes *sigh*

image

When you finish adding these two necessaries, it’ll pull some other files along for the ride as well so don’t be surprised about that.

6. Now that’s finished, we can open up our .CS file and start by importing the necessary namespaces namely:

using facebook;
using facebook.web;

and then, make our class inherit from the CanvasFBMLBasePage class that is part of the toolkit. This base class should take care of all the nitty gritties of dealing with Facebook and making sure it knows who you are (or in this case, your application)

public partial class _Default : CanvasFBMLBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}
 

7. Before we proceed, lets add a snippet to our web.config file to set our APIKEY and secret. The base class will be looking at our web.config file for the values to use to authenticate with Facebook. All you need to do is find this section:

image

and replace it with something like:

<appSettings>
  <add key="APIKey" value ="8e38f5fc72b989b8146dc91ece7e9b6a"/>
  <add key="Secret" value ="d9a5bd957d3aa1c69316839f1543fce0"/>
</appSettings>

of course put in the APIKey and Secret that was provided to you by Facebook. Don’t go using my key, it won’t work with your URL anyway :) Make sure you SAVE!

8. Going back to Default.aspx.cs, we can now proceed to add logic to our application.

protected void Page_Load(object sender, EventArgs e)
{
    base.Page_Init(sender, e); // this is the code that will call the base
                               // methods that deal with authenticating 
                               // with facebook and all that mumbo jumbo
 
if(!IsPostBack)    {
    stringuid = base.API.uid.ToString(); // this is the code to retrieve
                                          // the userid of the logged in user 
                                          //(the person accessing your application
   Content.Text = "<fb:profile-pic uid='" + uid + "'/>";               // You can also do something 
   Content.Text+= "hello, <fb:name uid='"+ uid + "' useyou='false'/>"; // like Response.Write( 
                                                                       // "<fb:profile-pic uid='" +
                                                                       // uid + "'/>"); for this part
   Content.Text += " you have "+ base.API.friends.get().Count + " friends so far "; 
   //anything you need to know about your user, you will find from base.API – all your base are belong to us



}}

9. Once that’s done, we can now go and publish our application by right-clicking on the project in solution explore and selecting publish

 image

Make sure you are publishing to the Callback URL you specified when you applied for the Application Key and Secret.

10. When you’re done publishing and you try to access the application, you should see something like this:

image

and when you click allow, you’ll get:

image

Some issues I noticed though is that when I try to access the application URL when I am logged out, Facebook tells me that the page cannot be found. But when I access it when I’m already logged in, it’ll prompt me to allow the application to access my information if i have not yet added the app. I’m checking with the forum on codeplex to see whether this is a Facebook issue or whether it’s the Tool'kit’s

Congratulations! You have now built your first FBML based Facebook application! Will let you know how far I go with this new framework.

It seems to be cleaner code right now, but I guess I’ll need to fool around with this to find out more.

Hope this helps!

Photosynth is out!

 
image

If some of you have seen Photosynth at its technical preview over at the live labs and have been ACHING to start making synths of your own, now you can! The project has gone live so you can head down now to http://photosynth.net and start uploading a batch of photos and start synthing. It’s a portal where you can also start viewing synths created by other users as well. Congratulations to the team. I personally can’t wait for the weekend to come so I can take my camera out for a trip to try it out!

Also, check out the Photosynth blog at http://blogs.msdn.com/photosynth/

Hosting Day Session – August 20, 2008

I did a session on Silverlight for Web Hosters yesterday, August 21, 2008 and have uploaded my here:

Content courtesy of Michael Scherotter. For those of you who are interested in the topic but missed the session, you can find his web cast at http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032373321&culture=en-US.  Most interesting for me was his discussion on how web analytics can easily be enabled in Silverlight and how the Silverlight programming model makes A/B testing on User Interfaces a lot easier because of its separation of UI and application logic. Highly recommended web cast.  :)

Posted by jocelyn | with no comments

SingTel Heart Race Test!

I had the great opportunity to help Crayon Digital get enabled on Silverlight for one of the projects they had to deliver for the SingTel Singapore Grand Prix and I have to say, they’ve come up with some pretty sleek stuff and I’m sure you GUYS will agree :) Check out the Heart Race Test which the team has very impressively built in less than a month, including time taken to build the concept, assets as well as honing Silverlight development skills!

Loads of videos on the Grid Girls but my favorite is how they used Deep Zoom. Check the site out!

image

Posted by jocelyn | with no comments
Filed under: ,

Yet another deep zoom application

Came across another really awesome Silverlight Application that makes use of Deep Zoom done by Kelly Blue Book which I believe they call The Perfect Car Finder. Tim Heuer talks about it more in his blog post. Building deep zoom applications can actually be pretty straightforward. All you need to do is make use of the Deep Zoom Composer to stitch and compose your source image, and it will automatically generate the .xap (Silverlight package) as well as a default html test page for you. Now if you want to take Deep Zoom a step further, here’s a post by KIRUPA.CHINNATHAMBI that shows how you can implement a deep zoom application that allows you to filter by tag (code included). Cool stuff!

Mix for Students: facebook development with .NET

I did a session on facebook development using the facebook developer toolkit where I also showed how I integrated my Piss Off Silverlight application into a facebook app, which I now call PissBook. I’ve registered the pissbook url but have yet to point it to my app as it seems that facebook isn’t allowing me to save it as “addable” on facebook :(  I forgot to put in the post add URL ^_^

 image

What I did was take this silverlight app:

image

And showed how you can make it work with data from facebook (or any other datasource for that matter). If you are using the default page generated by the Silverlight project, you would have something like:

image

on the Page_Load event, you should then be able to add values from your Request variable, in this case the logged in user name, and the friend’s name which i picked up from facebook’s friend-selector component, and pass these as InitParameters to my Silverlight Application.

image
I then needed to do a bit of tweaking in my App.xaml file on the Application_Startup method where I parsed the initialization Parameters and passed it to the constructor on my Page user control, which is basically my Silverlight application.

image

I then created a new constructor for my Page.xaml, which is more or less the same as the original one, except this accepts some parameters and assigns them to the textboxes in my application:

image

image

A simple application but it basically shows you how you can integrate your Silverlight applications with dynamic datasources through its InitParams property.

 

image

Code and slides are here:

* NOTE: for some reason, when you’re not logged in, facebook gives a 404 when i try to access the app directly from http://apps.facebook.com/facebooksession I’ll update this as soon as I find out a resolution.

this is apparently a 6-month old bug :( http://bugs.developers.facebook.com/show_bug.cgi?id=1406 still unresolved.

Win a Trip to Macau!

image

Send in your submissions now!

//These are one of those moments when I wish I DON’T work at Microsoft hehe

Posted by jocelyn | with no comments

Embed a font

If you want to embed a font into your Silverlight applications, add the font into your project:

image

Set the Build Action file property to embedded resource:

image

Use the following code snippet to use the font as a font source for your components:

Assembly ass = Assembly.GetExecutingAssembly();
Stream stream = ass.GetManifestResourceStream("EmbeddedResource.Font.pricedow.ttf");
this.test.FontSource = new FontSource(stream);
this.test.FontFamily = new FontFamily("Pricedown");

XAML looking something like:

<Grid x:Name="LayoutRoot" Background="White">
    <Canvas>
        <TextBlock x:Name="test" FontFamily="annifont.ttf#Annifont" Text="grand theft auto IV" FontSize="30"/>    
    </Canvas>
    
</Grid>

And the result:

image

Posted by jocelyn | with no comments
Filed under: ,

Bored to death

It was raining and I was a bit lazy to go home early so I decided to look for something to do. I wanted to try out some of the basic networking stuff with Silverlight and remembered googlefight

image

I thought it was a simple enough concept to implement so I figured I’d give it a try. I had some time to kill before my 11:00pm conference call. So I came up with “Piss Off!”.

// I have a feeling this won’t be up here for long as it might offend some people :)

 

This was an exercise for me to try out the Live Search API. Code is found here:

SharePoint and Silverlight

3I did a session for the SharePoint forum held July 1, 2008 and for those who are interested to try out the S+S BluePrints for SharePoint, the samples have so far not been updated to work with Beta 2 yet. So while that’s on the way, and you want to give a hack at trying to get it working yourselves:

1. Follow the steps detailed on this blog on how to configure your server to be able to serve out Silverlight applications. The last step tells you how to add a mime type, but instead of using application/x-silverlight-2-b1, change it to application/x-silverlight-2-b2 instead

2. I haven’t had time to convert the rest of the applications but 3 of them, I’ve managed to convert and upload on my Sky Drive folder

One of the first things you need to do is have the breaking changes document on hand :) This blog post has the link to the breaking changes document as well as some additions and corrections on the document.

You will also need to make an update to the web part project.

There is a line where you’re supposed to specify the Silverlight version in your web part class. The property used to be “.Version”. This was updated to MinumumVersion, which you should then set to “2.0.30523” as below:

silverlightControl.MinimumVersion = "2.0.30523";

Posted by jocelyn | with no comments

Sound problem with T61p – fix

I had just recently gotten at T61p for work and I have to say it’s a very sweet machine, with all its 1920X1200 pixels.  I did have a problem when my machine was running on battery, the sound seemed to choke every 1.5 seconds or so. My friend forwarded me the fix and i thought it might be useful to post this for others experiencing the same problems (i heard it’s not just me). Turns out, it’s the network card driver that’s causing all the trouble. This site has the driver update for pre-vista machines but the driver seems to work on vista as well, i just tried it out myself.

Check it out!

http://www-307.ibm.com/pc/support/site.wss/MIGR-67829.html

Posted by jocelyn | 1 comment(s)
Filed under:

Add Silverlight Link is gone?

Not sure if it’s just me experiencing this but in the past, when you create your SL app first then decide to add it to a new or existing website, all you had to do was have both the website and your sl app in the same solution, right click on the website and you should be able to right click on the website project and click on “add silverlight link”. That should allow you to be be able to keep working on your SL app and build into the client bin directory of your website.

If any of you have started working on Beta 2, the option seems to be gone. You will still be able to do so by clicking on the property pages of your website. when you click on add, you will see the familiar dialog box that allows you to choose which SL application in your solution to link to the website.

image

 

UPDATE: A more comprehensive list of ways to do the above can be found on http://blogs.msdn.com/webdevtools/archive/2008/06/06/what-s-new-with-silverlight-tools-beta-2.aspx

Along with the list of what’s new in the tools for Beta 2.

Posted by jocelyn | 4 comment(s)

Innovative use of Silverlight and DeepZoom

A lot of people have been saying that Deep Zoom is all for flashy washy stuff but check out this post by Tim Heuer on a video by Jose Fajardo.

/me is getting inspired to do my own site with tonnes of Deep Zoom stuff.

Innovative use of Silverlight and DeepZoom

Posted by jocelyn | 1 comment(s)
Filed under: ,
More Posts Next page »