Important Update for Facebook v4a Plugin

Just wanting to give a heads up about an important change coming to Facebook v4a. Starting next Tuesday(May 22) for New Builds (iOS and Android), the Facebook v4a plugin is going to be updated to 13.2.0 but Facebook now requires devs to include Facebook Client Token with in their project. When this update comes out (next week), you will see a new alert to add a Client Token to your build.settings if it’s not included.

Facebook v4a Documentation now includes where to place the Client Token in your build.settings

You can find the FB App Client Token Under: Your App>Settings>Advanced> “Scroll down to” Security

Build.settings should look something like this,

settings =
{
    android =
    {
        facebookAppId = "XXXXXXXXXX",  -- Replace XXXXXXXXXX with your Facebook App ID
        applicationChildElements =
        {
            -- Array of strings
            [[
                <provider android:authorities="com.facebook.app.FacebookContentProviderXXXXXXXXXX"
                          android:name="com.facebook.FacebookContentProvider" android:exported="true"/>
            ]],
                        [[
                <meta-data android:name="com.facebook.sdk.ClientToken" android:value="YYYYYYYYYYYYYYYYYYYYY"/>
            ]],
        }, -- Replace XXXXXXXXXX with your Facebook App ID and YYYYYYYYYYYYYYYYYYYYY with Facebook Client Token
    },
   iphone =
    {
        plist =
        {
            UIApplicationExitsOnSuspend = false,
            FacebookAppID = "XXXXXXXXXX",  -- Replace XXXXXXXXXX with your Facebook App ID
            CFBundleURLTypes =
            {
                { CFBundleURLSchemes = { "fbXXXXXXXXXX", } }  -- Replace XXXXXXXXXX with your Facebook App ID
            },
            FacebookClientToken = "XXXXXXXXXX",  -- Replace XXXXXXXXXX with your Facebook Client Token
            -- Whitelist Facebook apps
            LSApplicationQueriesSchemes =
            {
                "fb",  -- Needed for the facebook-v4a.isFacebookAppEnabled() API
                "fbapi",
                "fbauth2",
                "fb-messenger-api",
                "fbshareextension"
            },
        },
    },
    plugins =
	{
        ["plugin.facebook.v4a"] =
        {
            publisherId = "com.coronalabs",
        },
	},
}
3 Likes

Hi @Scott_Harrison ,

Good to see an update coming out.

@famousdoggstudios had raised a problem in one of the previous threads- with regard to events not being fired and an outdated plugin conceivably the cause. Can we expect this problem to be resolved with this update? Without the events, we can’t get attribution to work for fb ads. Would be really helpful if you could add the feature to log events.

There is a new Log Event function with the update, I don’t think there is a problem with the plugin being out of date thought (currently FB v4a is using 12.3 which was released in January of this year).

Okay. Are you planning on updating the documentation as well? Looks like information on the new Log Event function hasn’t been updated yet.

Log Event is not available now, and will be added to docs when update comes out next week.

1 Like

Okay, thanks.

@Scott_Harrison I’m about to push a new update today to Google Play and the App Store. Should it work fine if I get it out with a build before the update next week? Or will FB cause the old v4a plugin to stop working in apps already on the store?

Your good to release only for new build, plugins are static(we cannot your change code once you build)

@Scott_Harrison I’m working to implement the FB4a changes.

  1. Have you already updated the doc here? Solar2D Documentation — Plugins | Facebook (v4a)

Also, you have a comment that I need to replace YYYYYYYYYYYYYYYYY with Facebook Client Token. Everything I’ve read about this says that a short-lived token is required to get a long-lived token, and it’s only good for 60 days!

  1. Is this info incorrect? Pages API - Access Token - Documentation - Facebook for Developers

  2. If it isn’t the right info/doc for apps, can you please add to the docs, a set of clear instructions on how to obtain the right clientToken?

I can’t update my app on Android without solving this.

There will be another update to the docs this afternoon but the Client Token ~= Access Token.

See this note @troylyndon

@Scott_Harrison plist issue: UIApplicationExitsOnSuspend = false,

When I put this in my plist, I get this error when I attempt to DELIVER my IPA with Transporter: ERROR ITMS-90339: “This bundle is invalid. The Info.plist contains an invalid key ‘UIApplicationExitsOnSuspend’ in bundle Bible Trivia [Bible Trivia.app]”

@Scott_Harrison apparently, the plist issue RE: UIApplicationExistsOnSuspend is DEPRECATED.

It’s explained here: ios - UIApplicationExitsOnSuspend key issue. How do I fix it? - Stack Overflow

Can you please UPDATE the Facebook plugin doc so that this plist entry is removed? The stack overflow link includes another link to an explanation on how to turn on background modes, if required.

@Scott_Harrison FYI, after carefully following the directions with your link above to get the right client token, I have the iOS and Android versions working perfectly. :slight_smile:

Great

Also documentation has been updated and logEvent has been added

1 Like

@Scott_Harrison FYI, my game has been downloading the small thumbnails of people based upon their FB id. In other words, I get their FB id when they use FB Login. For my game ranking, I then transmit their FB id to my app on other people’s devices, and download the thumbnail with this url using this code, so that my ranking shows images of other players and their first names and last initial (or nickname).

LINK_FB_GETPHOTO_PREFIX=“https://graph.facebook.com/v3.2/
LINK_FB_GETPHOTO_SUFFIX="/picture" --?type=square" --/picture?type=large or ?type=normal
local URL=LINK_FB_GETPHOTO_PREFIX…FBid…LINK_FB_GETPHOTO_SUFFIX

Will that stop working with this new change?

Unless that pseudocode looks like just a basic url, FB plugin should not affect it

1 Like

@Scott_Harrison @vlads CRITICAL ISSUE BUILD 2022.3680 - The new problem appears related to this new Facebook v4a updated plugin

Apparently, App Store Connect REJECTS new builds using FBv4a made with Solar2D 2022.3680.

The identical code made with Solar2D 2022.3675 DOES NOT result in this email from App Store Connect. In fact, the older version doesn’t reject at all; I can test it in TestFlight and publish it if I want.

However, now that I’ve upgraded to Xcode 14 and iOS SDK 16, I can’t go back and use the earlier version of Solar2D.

Here’s the rejection email I received from AppStoreConnect:

App Store Connect\ 173x45

Dear Developer,

We identified one or more issues with a recent delivery for your app, “Jesus Bible Trivia Games Quiz” 5.31 (2022.10.70703). Please correct the following issues, then upload again.

ITMS-90482: Invalid Executable - The executable ‘Bible Trivia.app/Frameworks/FBAEMKit.framework/FBAEMKit’ contains bitcode.

ITMS-90482: Invalid Executable - The executable ‘Bible Trivia.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit’ contains bitcode.

ITMS-90482: Invalid Executable - The executable ‘Bible Trivia.app/Frameworks/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics’ contains bitcode.

Best regards,

The App Store Team

Vlad fixed this yesterday, and I was able to upload successfully to Apple. You might need to delete this file on your machine to force it to download the latest copy again:
/Users/{you}/Library/Application Support/Corona/Simulator/Plugins/catalog.json

@alanFlickGames @Scott_Harrison after removing the catalog.json file, I still get this same email and cannot upload a build to App Store Connect that they will accept.