Git Product home page Git Product logo

ane-facebook's Introduction

Air Native Extension for Facebook (iOS + Android)

This is an AIR Native Extension for the Facebook SDK on iOS and Android. It has been developed by FreshPlanet and is used in the game SongPop 2.

Facebook SDK Versions

  • iOS: 4.19.0
  • Android: 4.19.0

Installation

The ANE binary (AirFacebook.ane) is located in the bin folder. You should add it to your application project's Build Path and make sure to package it with your app (more information here). See it within our sample project's app descriptor here.

<extensions>
    ...
    <extensionID>com.freshplanet.ane.AirFacebook</extensionID>
</extensions>

iOS

Be sure to follow steps 1 and 4 of the Getting Started with the Facebook SDK for iOS guide.

Check out the sample project here for app descriptor inclusions.

Android

You will need to add the following activities and permission in your application descriptor:

<android>
    ...
    <manifestAdditions><![CDATA[
        <manifest android:installLocation="auto">
            ...
            <uses-permission android:name="android.permission.INTERNET"/>
            <application>
                ...
                <meta-data android:name="com.facebook.sdk.ApplicationId" 
                           android:value="fb{YOUR_FB_APPLICATION_ID}"/>

                <activity android:name="com.facebook.FacebookActivity" 
                          android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="{YOUR_FB_APPLICATION_NAME}" />

                <activity android:name="com.freshplanet.ane.AirFacebook.LoginActivity" 
                          android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" />

                <!-- If you're sharing links, images or video via the Facebook for Android app, you also need to declarthe   FacebookContentProvider in the manifest. -->
                <provider android:authorities="com.facebook.app.FacebookContentProvider{YOUR_FB_APPLICATION_ID}" 
                          android:name="com.facebook.FacebookContentProvider" 
                          android:exported="true"/>
            </application>
        </manifest>
    ]]></manifestAdditions>
</android>

You can check out our example of this in our sample project here.

NOTE: It is important to prefix YOUR_FB_APP_ID with "fb" in <meta-data> (and ONLY in <meta-data>) tag, because obug in Android manifest file (http://stackoverflow.com/questions/16156856/android-facebook-applicationid-cannot-be-null)Facebook SDK code in this ANE was modified to recognize FB_APP_ID prefixed with "fb".

Using the ANE

Once installed you can initialize the ANE...

Facebook.instance.init("0123456789", _initCallback);

and it will be ready to go! Check out our sample code to aid you.

Build from source

Should you need to edit the extension source code and/or recompile it, you will find an ant build script (build.xml) in the build folder:

cd /path/to/the/ane

# Setup build configuration
cd build
mv example.build.config build.config
# Edit build.config file to provide your machine-specific paths

# Build the ANE
ant

Authors

This ANE has been written by Thibaut Crenn, Alexis Taugeron, Renaud Bardet, and Adam Schlesinger. Rewrites and modifications to version SDK 4.x were made by Ján Horváth.

ane-facebook's People

Contributors

adamfp avatar alexish avatar ataugeron avatar florianbernard avatar freshtiti avatar iiilx avatar kirillkuvaldin avatar mateo-kozomara avatar nigamshah avatar nodrock avatar pnico avatar renaudbardet avatar rraway avatar shinyamos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.