Ugrade notes for AIRFacebook 1.5.0

The AIRFacebook extension has been updated to v1.5.0. There are no changes to the ActionScript API, however, the underlying Facebook SDKs have been updated to v4.20.2 (iOS) and v4.20.0 (Android). See below to learn what changes you need to make in order to use this new version of the extension.

Minimum iOS version

The newer Facebook iOS SDK is now built for iOS 8+. You may need to specify the minimum iOS version for your app to avoid warnings when packaging IPA:

<iPhone>
    <InfoAdditions>
        <![CDATA[
            ...

            <key>MinimumOSVersion</key>
            <string>8.0</string>

            ...
        ]]>
    </InfoAdditions>
</iPhone>

iOS 10 support

If your app allows access to user’s photo library then add the following key to InfoAdditions to avoid crashes on iOS 10+. Make sure to set your own reason message:

<iPhone>
    <InfoAdditions>
        <![CDATA[
            ...

            <key>NSPhotoLibraryUsageDescription</key>
            <string>{human-readable reason for photo library access}</string>

            ...
        ]]>
    </InfoAdditions>
</iPhone>

Automatic app activation logging

The Facebook SDK now automatically logs basic information like app activation, thus you can set the second parameter in the AIRFacebook.init() method to false:

AIRFacebook.init( FACEBOOK_APP_ID, false );

If you want to disable auto-logging made by the SDK, add the following information to your app descriptor.

For iOS:

<iPhone>
    <InfoAdditions>
        <![CDATA[
            ...

            <key>FacebookAutoLogAppEventsEnabled</key>
            <false/>

            ...
        ]]>
    </InfoAdditions>
</iPhone>

For Android:

<android>
    <manifestAdditions>
        <![CDATA[
        <manifest>
            ...

            <application>
                ...

                <meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
                           android:value="false"/>

                ...
            </application>
        </manifest>
        ]]>
    </manifestAdditions>
</android>

Additional Android libraries

The Facebook SDK for Android now requires new resources which are not available in AIR by default. You need to include the extensions below (download from this repository):

<extensions>
    <extensionID>com.marpies.ane.androidsupport.appcompat</extensionID>
    <extensionID>com.marpies.ane.androidsupport.vectordrawable</extensionID>
    <extensionID>com.marpies.ane.androidsupport.animatedvectordrawable</extensionID>
</extensions>
Important: If you are using AIR 25+ then no other changes are needed. However, if you are using AIR 24 or older then you need to make a change to your AIR SDK installation to be able to package your app for Android. If you do not want to make any changes, you will have to use AIRFacebook v1.4.5 or older.

The change involves removing the android package inside runtimeClasses.jar file that is located in AIR_SDK/lib/android/lib. You can do it manually by unzipping the JAR file, removing the android directory and zipping the rest of the classes again, renaming it back to runtimeClasses.jar. You can skip this process and download one of the ready-to-use JAR files:

Note you may receive a warning in certain browsers as JAR files are considered potentially dangerous.

Updated Graph API version

The native SDKs now target Graph API v2.8. If you are using some API that has changed you may be required to modify your code. You can view the Graph API changes here.

New extension package

A new extension package is now available for use. You only need to use this package in case you experience problems when packaging IPA for iOS. The package does not include Facebook iOS frameworks, these are provided separately in iOS-frameworks.zip. The packaging problem may be resolved by using this ANE and by unzipping the Facebook iOS frameworks to AIR_SDK/lib/aot/stub directory.

Leave a Comment