Air Native Extension (iOS and Android) for the Facebook mobile SDK

Related tags

SDK ANE-Facebook
Overview

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.

Comments
  • Can't connect with Android devices

    Can't connect with Android devices

    Hi,

    I'm trying to connect on a few Android devices and I'm not able to connect to facebook. When turning on the log, I get:

    [Facebook] INFO - InitFunction, session={Session state:CREATED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:570287986354141}

    My as3 code: _facebookConnect = Facebook.getInstance(); _facebookConnect.logEnabled = true; _facebookConnect.init(ConfigManager.getConstant("facebook-id")); _facebookConnect.openSessionWithReadPermissions(["read_stream", "email"], _onSessionOpened);

    private function _onSessionOpened(success:Boolean, userCancelled:Boolean, error:String = null) : void { trace(this, "_onSessionOpened", success, userCancelled, error); }

    I've created the facebook app following the guidelines found on : http://afterisk.wordpress.com/2013/02/26/first-free-facebook-single-sign-on-sso-adobe-air-native-extension-for-android/

    image

    I've set the manifestAdditions in the application-descriptor.xml as described in the documentation.

    Is there something I forgot?

    BTW: the ANE works perfectly on iOS.

    opened by cordechasse 32
  • {AppName} has been making recent API calls to Graph API v2.0

    {AppName} has been making recent API calls to Graph API v2.0

    Hi, i got that email from facebook:

    "{AppName} has been making recent API calls to Graph API v2.0, which will reach the end of the 2-year deprecation window on Monday, August 8, 2016. Please migrate all calls to v2.1 or higher in order to avoid potential broken experiences."

    Does anyone know how to migrate all calls to v2.1 or higher?

    Thank you!

    opened by yokoboko 29
  • Android

    Android "Unfortunately, [app_name] has stopped"

    When I am trying to fb login this message appears: "Unfortunately, [app_name] has stopped". Latest ANE ver. Please help me to solve this problem. Thank you!

    My manifest:

                    <!-- Only this application can receive the messages and registration result -->
                    <permission android:name="air.[app_name].permission.C2D_MESSAGE" android:protectionLevel="signature" />
                    <uses-permission android:name="air.[app_name].permission.C2D_MESSAGE" />
    
                    <!-- This app has permission to register and receive message -->
                    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    
                    <application>
    
                        <activity android:name="com.freshplanet.nativeExtensions.NotificationActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    
                        <receiver android:name="com.freshplanet.nativeExtensions.C2DMBroadcastReceiver"
                        android:permission="com.google.android.c2dm.permission.SEND">
    
                            <!-- Receive the actual message -->
                            <intent-filter>
                                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                                <category android:name="[app_name]" />
                            </intent-filter>
    
                            <!-- Receive the registration id -->
                            <intent-filter>
                                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                                <category android:name="[app_name]" />
                            </intent-filter>
                        </receiver>
    
                        !-- Local notification -->
                        <service android:name="com.freshplanet.nativeExtensions.LocalNotificationService"/>
                        <receiver android:name="com.freshplanet.nativeExtensions.LocalBroadcastReceiver" android:process=":remote"></receiver>
    
                        <activity android:name="com.facebook.LoginActivity"/>
                        <activity android:name="com.freshplanet.ane.AirFacebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
                        <activity android:name="com.freshplanet.ane.AirFacebook.ShareDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
                        <activity android:name="com.freshplanet.ane.AirFacebook.ShareOGActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
                        <activity android:name="com.freshplanet.ane.AirFacebook.WebDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
    
                        <activity android:name="com.freshplanet.inapppurchase.activities.BillingActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"></activity>
                    </application>
                </manifest>
    
    opened by YeeshaYe 20
  • Ane-Facebook Working Example (Read/Publish)

    Ane-Facebook Working Example (Read/Publish)

    Hello

    After the last commit from our friend @ataugeron I make a new example to help you when you are going to use the ANE-Facebook from freshplanet

    Download the example from the git: https://github.com/messi89/OverGenANE

    Screens: http://imageshack.us/scaled/landing/22/n544.png http://img33.imageshack.us/img33/9012/k6oe.png

    opened by messi89 20
  • Everything fine until SSO

    Everything fine until SSO

    Hi again,

    Everything was working fine today. I finally was able to log into facebook, do the authentication etc. We were testing and all was great until we hit a phone who had SSO. A phone who has facebook app already installed, and a facebook account already created. It loads up the login screen, then it jumps to the "app wants to get your info", and then "success = false, usercancelled=true, error = null".

    I think issue #88 was the same problem.

    I thaught, hey maybe it will work if I delete the facebook account, and the log back in. So i did that, and after the login page, a facebook page poped up, it loaded something and tried syncing stuff, and in the end the same result. "success = false, usercancelled=true, error = null".

    Any idea? What can i do for a workaround? We did this on a galaxy s3, and on a motorolad droidx. Same errors.

    opened by kerike 20
  • Login issue

    Login issue

    I've written several applications in andoid using this ane and everything was working fine. I had some complaints about facebook login not working, but there were a very small number, and I didn't take them into consideration.

    Well last week we bought a new phone, a Samsung Galaxy s3 with android 4.3.3. I have a Samsung Galaxy s3 also, on which I've tested all my apps. Android version 4.3.

    When I try to login on the new phone, the login process does not finish. What I am seeing is that it tries to login over and over again. I've deleted the facebook app and tried to login without SSO, and the same result: the login page pops back up and says you have to be logged in. I type in my email and pass, login and the same page pops back up.

    The same app works fine on my phone, my coworkers phone and my bosses tablet.

    What could be the problem? Can anyone give me an idea where to look for problems?

    I've tried building the app with air 3.9 and 4.0, no clue. I've downloaded the songpop app, and it works on all devices. The OverGen tutorial doesn't work on the new phone only on the old one.

    Thanks.

    opened by kerike 13
  • App Crash on Android Login

    App Crash on Android Login

    Hello, Many thanks for the ANE! It works fine on iPad running iOS6.

    However, when I try to openSession on iPad running iOS5 or on an Android device, the app crashes without any log. This happens either with or without the facebook app installed on the device.

    Here is my code:

    private var facebook :Facebook;
    facebook = Facebook.getInstance();
    facebook.logEnabled = true;
    facebook.init("MY_APP_ID");
    
    var permissions:Array = ["publish_stream", "user_photos", "user_about_me"];
    facebook.openSessionWithPublishPermissions(permissions, myCallback);
    

    Any help would be appreciated! Thanks

    opened by ghost 11
  • iOS6 permissions request returning userCancelled as true

    iOS6 permissions request returning userCancelled as true

    The ANE is working great on iOS7. I borrowed a coworkers iPhone 4 with iOS 6.1.3.

    When performing the openSessionWithPublishPermissions call, the callback receives userCancelled as true, even though I am clicking "Okay". The Don't Allow option is properly setting the APPLICATION_TURNED_OFF error.

    Is this a known issue? Is there a way to force webview authentication as a quickfix? I already have a SystemProperties ANE which allows me to detect the iOS version.

    opened by eric-holmes 9
  • Crash Project Connect Facebook

    Crash Project Connect Facebook

    I make 1 project connect facebook use ANE-Facebook. But bug :

    //Output when run test project Facebook.isSupported : true [Facebook] INFO - InitFunction, appID=220662714755911 [Facebook] INFO - InitFunction, session={Session state:CREATED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:220662714755911} [Facebook] INFO - IsSessionOpenedFunction [Facebook] INFO - IsSessionOpenedFunction, AirFacebookExtensionContext=com.freshplanet.ane.AirFacebook.AirFacebookExtensionContext@40670e48 [Facebook] INFO - IsSessionOpenedFunction: session.isOpened false [Facebook] INFO - LoginActivity.onCreate [Facebook] INFO - LoginActivity.onCreate, session.isClosed false, state CREATED

    //Output screen mobile Error : Sorry! The application Test(process air.air.Test) has stopped unexpectedly. Please try again.

    Pls help me!

    opened by anhtran1989 9
  • Crash on iOS 5.1.1

    Crash on iOS 5.1.1

    Crash on iOS 5.1.1 but iOS 6.1.1 is OK. The errors: Jun 5 12:19:25 unknown UIKitApplication:ANEFacebook[0x73cd][581] : Facebook.isSupported true Jun 5 12:19:26 unknown ANEFacebook[581] : [AirFacebook] Trying to open session with readAndPublish permissions: ( ) Jun 5 12:19:26 unknown ANEFacebook[581] : -[__NSCFDictionary setObject:forKeyedSubscript:]: unrecognized selector sent to instance 0x983ee0 Jun 5 12:19:26 unknown ANEFacebook[581] : *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKeyedSubscript:]: unrecognized selector sent to instance 0x983ee0' *** First throw call stack: (0x358f588f 0x33519259 0x358f8a9b 0x358f7915 0x35852650 0x68db11 0x68d9fd 0x68cc51 0x67e211 0x4d983c 0x35c3c8 0x61e367 0x61d9b5 0x61dd23 0x61dabf 0x61cc93 0x5e6d23 0x61d67d 0x61cc93 0x5e6d23 0x61d67d 0x61d46b 0x61cc93 0x5e6d23 0x61d67d 0x61d46b 0x61cc93 0x5e6d23 0x61d709 0x61d46b 0x61dddb 0x61e02f 0x5e6651 0x5c11af 0x61e367 0x61d9b5 0x61dcfb 0x61dabf 0x61d46b 0x61cc93 0x5e6d23 0x61d67d 0x61d46b 0x5eeb33 0x5e6745 0x61c6cb 0x2dba18 0x2db27c 0x2db084 0x2de014 0x3e3e98 0x34f260 0x61e367 0x61d9b5 0x61dd23 0x61dabf 0x61d46b 0x61cc93 0x5e6d23 0x61d709 0x61d46b 0x5eeb33 0x5e6745 0x61c6cb 0x3e3a48 0x3e39cc 0x23c9cc 0x23d05c 0x238c20 0x23d0c8 0x1d15e0 0x1d2010 0x10954c 0x10a258 0x2b96fc 0x32a6e86f 0x32a6e7c5 0x36b3a001 0x3579560d 0x358bef13 0x358c9523 0x358c94c5 0x358c8313 0x3584b4a5 0x3584b36d 0x335e6439 0x33023cd5 0x1faef0 0x67d17c) Jun 5 12:19:26 unknown UIKitApplication:ANEFacebook[0x73cd][581] : terminate called throwing an exception Jun 5 12:19:26 unknown ReportCrash[583] : Formulating crash report for process ANEFacebook[581]

    opened by ColerYu 9
  • Android Auth Dialog returns to black screen

    Android Auth Dialog returns to black screen

    When I integrate the latest ANE in my Android AIR app, then I try the Login function:

    facebook.openSessionWithReadPermissions( permsArray, onLoginComplete );
    

    the the auth dialog returns to a black screen, are you getting the same issue?

    opened by sscholle 9
  • Error occurred while packaging the application:

    Error occurred while packaging the application:

    I got the following error:

    aapt tool failed:C:\Users\torora\AppData\Local\Temp\0a4ace11-898a-4498-8467-2b361d0803c8\AirFacebook-facebook-common-res\values\values.xml:71: error: Error retrieving parent for item: No resource found that matches the given name '@style/Theme.AppCompat.NoActionBar'.

    C:\Users\torora\AppData\Local\Temp\0a4ace11-898a-4498-8467-2b361d0803c8\AirFacebook-facebook-common-res\values\values.xml:76: error: Error retrieving parent for item: No resource found that matches the given name '@style/Theme.AppCompat.Dialog'.

    I tried the following solutions, but no success:

    • Added ANEs of AppCompatV7 and CardViewV7 from Distriqt, the APK was packaged successfully but it does not work on the device.
    • I used @CaptainHug branch: it works well for 32Bits. Unfortunately, it's not updated to support 64Bits.

    Could you help please?

    opened by goodamr 2
  • Export Build Error

    Export Build Error

    aapt tool failed:/private/var/folders/3m/lw5f925j18v6d1w5yc6d27sw0000gn/T/d87b10b5-f499-4ef1-9a93-bc849f2c237b/AirFacebook-facebook-common-res/values/values.xml:71: error: Error retrieving parent for item: No resource found that matches the given name '@style/Theme.AppCompat.NoActionBar'.

    /private/var/folders/3m/lw5f925j18v6d1w5yc6d27sw0000gn/T/d87b10b5-f499-4ef1-9a93-bc849f2c237b/AirFacebook-facebook-common-res/values/values.xml:76: error: Error retrieving parent for item: No resource found that matches the given name '@style/Theme.AppCompat.Dialog'.

    opened by kantar35 1
  • ANE Does not work on Android

    ANE Does not work on Android

    On iOS, everything works, but it does not work on Android. Compilation occurs without errors, but after running on the android, the feeling that it does not even understand that this is Facebook tested on xiaomi mi 9, honor 20 and honor 10

    Still need to upgrade to Facebook sdk v5 +

    opened by drGippo 0
  • Error #1069: Property value not found on String and there is no default value.

    Error #1069: Property value not found on String and there is no default value.

    Hi,

    I tried the ANE with the sample project and got this error when trying to test the logEvent. This is the only feature that I need, and I don't get the error. I didn't change a single line on the test project, but maybe I didn't fill up the facebook page accordingly. For the record, the issue happens on the second line:

    var event:FBEvent = FBEvent.create_ACTIVATED_APP();
    ane.logEvent(event);
    

    Thanks a lot for your help!

    opened by yvant 0
  • IOS compiling error: ld: library not found for -lclang_rt.ios

    IOS compiling error: ld: library not found for -lclang_rt.ios

    When i try compile, using FlashBuilder4.7 on Windows10, rise following error

    Error occurred while packaging the application:

    ld: library not found for -lclang_rt.ios ld: library not found for -lclang_rt.ios Compilation failed while executing : ld64

    current: AIR SDK 30

    opened by mideon 1
Owner
Freshplanet
Freshplanet
Sdk-android - SnapOdds Android SDK

Documentation For the full API documentation go to https://snapodds.github.io/sd

Snapodds 0 Jan 30, 2022
Segmenkt - The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment

SegmenKT Kotlin SDK The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment. I

UNiDAYS 0 Nov 25, 2022
Frogo SDK - SDK Core for Easy Development

SDK for anything your problem to make easier developing android apps

Frogobox 10 Dec 15, 2022
HubSpot Kotlin SDK 🧺 Implementation of HubSpot API for Java/Kotlin in tiny SDK

HubSpot Kotlin SDK ?? Implementation of HubSpot API for Java/Kotlin in tiny SDK

BOOM 3 Oct 27, 2022
Glassfy React Native SDK

Open source SDK to quickly integrate subscriptions, stop worring about code maintenance, and getting advanced real-time data. Full support for Android.

glassfy 8 Sep 6, 2022
Desk360 Mobile Chat SDK for Android

Desk360 Chat Android SDK Introduction Desk360 Live Chat SDK is an open source Android library that provides live support to your customers directly fr

null 31 Dec 13, 2022
A sample project of implementing Liveness Detection and Identity OCR on Android app using Kredibel Vision SDK

Vision Sample (Android) A sample project of implementing Liveness Detection and Identity OCR on Android app using Kredibel Vision SDK. You can checkou

null 10 Nov 27, 2022
This SDK can be used to identify a user via passport or ID Card prove identity of user via Biometry comparing selfie and photo from chip of ID Doc

Verdi Mobile SDK This SDK can be used to identify a user via passport or Id Card. In this repository, you can find the library itself and the Sample a

null 5 Jan 3, 2022
AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

AWS Amplify 976 Dec 29, 2022
Countly Product Analytics Android SDK

Countly Android SDK We're hiring: Countly is looking for Android SDK developers, full stack devs, devops and growth hackers (remote work). Click this

Countly Team 648 Dec 23, 2022
Android Real Time Chat & Messaging SDK

Android Chat SDK Overview Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emer

Applozic 659 May 14, 2022
Evernote SDK for Android

Evernote SDK for Android version 2.0.0-RC4 Evernote API version 1.25 Overview This SDK wraps the Evernote Cloud API and provides OAuth authentication

Evernote 424 Dec 9, 2022
Android Chat SDK built on Firebase

Chat21 is the core of the open source live chat platform Tiledesk.com. Chat21 SDK Documentation Features With Chat21 Android SDK you can: Send a direc

Chat21 235 Dec 2, 2022
Liquid SDK (Android)

Liquid Android SDK Quick Start to Liquid SDK for Android This document is just a quick start introduction to Liquid SDK for Android. We recommend you

Liquid 17 Nov 12, 2021
AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

AWS Amplify 975 Dec 24, 2022
新浪微博 Android SDK

ReadMe 公告: 鉴于线上服务器出现问题,推荐下载本地aar后上传到自己公司的服务器,保证后续服务稳定, 我们也将尽快重新提供一个稳定的地址供大家使用。 新包地址:https://github.com/sinaweibosdk/weibo_android_sdk/tree/master/2019

SinaWeiboSDK 1.8k Dec 30, 2022
Official Appwrite Android SDK 💚 🤖

Appwrite Android SDK This SDK is compatible with Appwrite server version 0.8.x. For older versions, please check previous releases. Appwrite is an ope

Appwrite 62 Dec 18, 2022
This App is sending Face capture data over network, built around the latest Android Arcore SDK.

AndroidArcoreFacesStreaming From any Android phone ArCore compatible, using this app will send over TCP 5680 bytes messages: The first 5616 bytes is a

Maxime Dupart 30 Nov 16, 2022
Trackingplan for Android SDK

With Trackingplan for Android you can make sure that your tracking is going as you planned without changing your current analytics stack or code.

Trackingplan 3 Oct 26, 2021