Trouble Moving to Facebook v4

I’m working on moving over to the facebookV4 plugin and having issues.  I changed the build.settings as per the documentation and changed the “require” line.  Now, when I first start the app on my device, I get a pop up immediately that says “ERROR:  Need Facebook App ID”.  Then it provides a couple of buttons ‘Get App ID’ and Integrate in Corona’.  Are there other things I need to change in the facebook.login code?

 

BTW… I’m only working with Android right now.

 

Here is my build.settings code:

 

[lua]settings =

{

android =

    {        

versionCode = “10”,

        usesPermissions =

        {

            “android.permission.INTERNET”,

            “android.permission.READ_EXTERNAL_STORAGE”,

            “android.permission.WRITE_EXTERNAL_STORAGE”,

            “android.permission.ACCESS_FINE_LOCATION”,

            “android.permission.ACCESS_COARSE_LOCATION”,

        },

        usesFeatures =

        {

            { name=“android.hardware.camera”, required=false },

            { name=“android.hardware.location”, required=false },

            { name=“android.hardware.location.gps”, required=false },

        },

        {

        largeHeap = true

        },

{

facebookAppId = “XXXXXXXXXXX”,

},

    },

window = 

{

defaultMode = “normal”,

defaultViewWidth = 640,

defaultViewHeight = 960,

resizable = true,

minViewWidth = 320,

minViewHeight = 480,

enableCloseButton = true,

enableMinimizeButton = true,

enableMaximizeButton = true,

suspendWhenMinimized = true,

titleText = {

            – The “default” text will be used if the system is using a language and/or

            – country code not defined below. This serves as a fallback mechanism.

            default = “Window Title Test”,

            – This text is used on English language systems in the United States.

            – Note that the country code must be separated by a dash (-).

            [“en‐us”] = “Window Title Test (English‐USA)”,

            – This text is used on English language systems in the United Kingdom.

            – Note that the country code must be separated by a dash (-).

            [“en‐gb”] = “Window Title Test (English‐UK)”,

            – This text is used for all other English language systems.

            [“en”] = “Window Title Test (English)”,

            – This text is used for all French language systems.

            [“fr”] = “Window Title Test (French)”,

            – This text is used for all Spanish language systems.

            [“es”] = “Window Title Test (Spanish)”,

        },

    },

orientation =

{

default = “landscapeRight”,

},

iphone = 

{

plist =

{            

UIStatusBarHidden = true,

            UIApplicationExitsOnSuspend = false,

            FacebookAppID = “XXXXXXXXXXX”,

            CFBundleURLTypes =

            {

                { CFBundleURLSchemes = { “fbXXXXXXXXXXX”, } }

            }

},

},

plugins =

{

        [“plugin.facebook.v4”] =

        {

            publisherId = “com.coronalabs”,      

        },

   [“plugin.GameThrivePushNotifications”] =

   {

       publisherId = “com.gamethrive”,

   },

   [“plugin.google.play.services”] =

   {

publisherId = “com.coronalabs”,

supportedPlatforms = { android=true },                

    },

},

}[/lua]

Did you change all of the “XXXXXXXXXXX”'s to your App ID from the Facebook Developer portal?  There are three places you have to set this and one (pay attention to the one that starts “fb”. The “fb” needs to prefix your AppID number.)

Rob

Yes, my App ID is in all three of those places and I made sure fb preceded in the ios section. I just didn’t want to place that here.

It seems as though I’m missing some other step, but I’ve read over the forums and documentation many times over now. Here is a screens hot of what I’m seeing.

To be clear, it was working fine 2 days ago before switching to v4, but it sounds as though we will be required to switch pretty soon, so I figured I would implement the change now.

You typed in your facebook appId into your android “build.settings” wrong.  You currently have it like this…

settings = { android = { { facebookAppId = "", }, }, }

 
You need to change it to this…

settings = { android = { facebookAppId = "", }, }

 
 
See the documentation here…
https://docs.coronalabs.com/daily/plugin/facebook-v4/index.html#android

Can’t believe I missed that… Thanks Rob.  You da man!  Works great!

Josh is da man! He caught the extra curly braces. Props to Josh!

Oh, I see that now… Thanks Josh… you da man too!

Happy to help! :slight_smile:

Did you change all of the “XXXXXXXXXXX”'s to your App ID from the Facebook Developer portal?  There are three places you have to set this and one (pay attention to the one that starts “fb”. The “fb” needs to prefix your AppID number.)

Rob

Yes, my App ID is in all three of those places and I made sure fb preceded in the ios section. I just didn’t want to place that here.

It seems as though I’m missing some other step, but I’ve read over the forums and documentation many times over now. Here is a screens hot of what I’m seeing.

To be clear, it was working fine 2 days ago before switching to v4, but it sounds as though we will be required to switch pretty soon, so I figured I would implement the change now.

You typed in your facebook appId into your android “build.settings” wrong.  You currently have it like this…

settings = { android = { { facebookAppId = "", }, }, }

 
You need to change it to this…

settings = { android = { facebookAppId = "", }, }

 
 
See the documentation here…
https://docs.coronalabs.com/daily/plugin/facebook-v4/index.html#android

Can’t believe I missed that… Thanks Rob.  You da man!  Works great!

Josh is da man! He caught the extra curly braces. Props to Josh!

Oh, I see that now… Thanks Josh… you da man too!

Happy to help! :slight_smile: