Creating a Facebook application. A place for your app to connect to
In the first part of this series of Adobe Air + Facebook SDK, we talked about how the ANE works in general and what are the overall steps to take for integrating Facebook SDK ANE into your Air apps. Now we are going through details with this post and talk about how you can create a new Facebook application and set it up ready for connecting it to your Air app.
By the end of this tutorial, you will know all the necessary settings required in the Facebook developer console and you will be ready to connect your mobile app to it.
Create a new FB app
go to https://developers.facebook.com/ and after logging into your Facebook account, you will be able to add a new app.
A popup will open for you to chose your platform. if you are going to have Android and iOS both, just click the “advanced setup” at the bottom and then we will manually add both platforms.
Another popup will open in which you can enter your app name. This name will help you identify your app easily and you can use spaces. then choose your app category and subcategory and hit the “create App ID” button.
Well, your new Facebook app is ready and you have your App ID required by the extension. but you still need to tell this app what platforms you are going to work in and you also need to introduce your Air app to this console. before we go with those settings, please have a closer look at the screenshot and you will see an empty green circle next to “my new game” string! that means that your Facebook app is offline. we’ll get to that later in the last step.
From the left menu click on “Settings” and in the new page that opens, click on “Add Platform”. you can choose one platform at once so you need to add platforms once for Android and another time for iOS. When you do this, both platforms will be shown in the same “settings” as seen in the next screenshot.
As you see in the screenshot, you are asked to enter your app package name for Android and Bundle ID for the iOS section. they only thing that you should be careful with is that when you build on Android, it will automatically put an extra .air to the beginning of your package name.
You also need to enter your AdobeAir entry activity which is ALWAYS AppEntry. as you see I have put air.com.doitflash.exFacebook2.AppEntry
in your case, if your package name is air.com.site.yourApp, then you must enter air.com.site.yourApp.AppEntry in this field.
For the iOS part, you should enter your iPhone/iPad store ID in the field but you certainly can’t because you have not yet submitted your app to the apple store! to be able to do your tests, just enter 0 and save your changes. whenever your app is online, you can return to this settings and place your real store IDs. Also make sure to switch on “Single Sign On”
On the Android section, there is an empty field named Key Hashes. you will generate this hash key offline in your Air app using FB.hashKey property. I will talk more about this later in part 3 of these tutorials.
As the final step, go to “Status & Review” page from the left menu and put your newly created Facebook app online. by doing this, you will be able to test and run your Air app and it will correctly connect to this app.