FaceBook SDK Integration

I am not going to go through the integration of the Facebook SDK although I will provide the link I used to get it working and the heartache I went through. Please see my working post below. The purpose of this post is to inform you of the heartache I suffered. I do not reply to emails with hard work you wil get it working. A programmers best tool is perseverance.

Mouse Catcher FaceBook Post

Mouse Catcher FaceBook Post

Integration went fine although only finished at 1:15 am on a sunday morning.

Inspect the code, as it only posts messages i.e. text so you will probably want to post something like this if you want a big icon like the professionals.

params.putString(“caption”, “Mouse Catcher on Android”);
params.putString(“picture”,”https://link to pic on google play”);

params.putString(“caption”, “Download XYZ”);
params.putString(“description”, “Your Description” );
params.putString(“name”,”Your App Name”);
params.putString(“link”,”link to your app on google play”);  // this confused me
params.putString(“facebookMessage”, “You msg to the user on facebook”);

As the developer I could post to facebook with no issues. I was well happy. The following day after a few hours sleep, I visited my parents house for a great British cooked breakfast. I asked my parents to both try and post their high scores to facebook using my android app. Each of them tried but each time it failed with either an authentication issue or a force close. This was weird I thought. I was banging my head against a brick wall. Why does it work on my phone and no one elses. Several hours passed and suddenly a ha. I am the developer. I had forgotten to turn the sandbox mode off in the developer page on facebook. If this is enabled only the developer will be able to use the app. Also there was a slight issue with the HashKey you must supply to you facebook developer app. Most posts reference the debug keystore. Once you are happy and releasing your app make sure you generate the HashKey using the release keystore.

I hope this helped. If you require imformaton on how to integrate facebook with your android app, the following resource was a life saver.



Comments are closed.