Basic Problem

Hi there,

I’m upgrading from the old facebook code to v4.

I feel a bit sheepish making this post, as there is obviously something very basic I’m missing.

But first, it looks like there’s a problem with the documentation:

settings =
{
android =
{
facebookAppId = “XXXXXXXXXX”, – Replace XXXXXXXXXX with your Facebook App ID
},
},

Using this, I get an ‘incorrect capitilisation’ warning when Corona starts.  If I change it to FacebookAppId with a capital F then the warning disappears.

Now as I said the problem I’m experiencing would appear to be a very simple one.  This code that I’ve copied and pasted from the doco gives me an error:

local facebook = require( “plugin.facebook.v4” )

print( "Is a Facebook app installed and accessible? " … tostring(facebook.isFacebookAppEnabled()) )

"Bad argument #1 to ‘tostring’ (value expected)

facebook.isFacebookAppEnabled() doesn’t exist.  The plugin is obviously loaded, otherwise I’d get other errors, so why can’t I make this function call?

I am using 2016.2992

thanks

well maybe it’s not me after all.  I just loaded the sample facebook app in the simulator, and clicking the ‘Facebook App Enabled’ button gives me the same error.  So obviously this function doesn’t exist after all!

okay so i build and run the facebook app, and there’s no problem calling this function on android.  Why doesn’t the simulator handle it (that’s what a simulator is meant to do isn’t it?)

thanks

We’ve added a parser to make sure build.settings has things we are looking for. It’s possible that we don’t have that check exactly right. I’ll let engineering know and they can address the false positive. This is just warning and you can ignore it for the time being.

Rob

Can you PM me the build.settings file that causes the “incorrect capitalization” warning?  I’m not getting it with the Facebook project in the CoronaSDK Samples which has the same spelling of “facebookAppId” as you show above.

Also, if you delete the plugin_facebook_v4.lua in the /Users/[YOUR_USERNAME]/Library/Application Support/Corona/Simulator/Plugins directory and reload your project using the Facebook-v4 plugin, the simulator should download a new stub Lua file which addresses the issue you were having with facebook.isFacebookAppEnabled().

Hi Perry, I don’t seem to be able to reproduce the illegal capitalisation warning any more.

Which is the correct one to use?

thanks

In the settings.iphone.plist table it’s:  FacebookAppID

In the settings.android table it’s: facebookAppId

See: https://docs.coronalabs.com/plugin/facebook-v4/index.html

Rob

how strange, I got the incorrect capitalisation warning again (without changing anything!!).

I’ve noticed where I went wrong though, it was a capital D on the end

22:03:12.604  WARNING: unrecognized key: settings.android.facebookAppID (string) (incorrect capitalization)

Its the last capital D. For iOS the last D is capital. For Android it’s a lower case ‘d’. If it helps, copy and paste from what I typed in above. It’s directly from the documentation.

Rob

well maybe it’s not me after all.  I just loaded the sample facebook app in the simulator, and clicking the ‘Facebook App Enabled’ button gives me the same error.  So obviously this function doesn’t exist after all!

okay so i build and run the facebook app, and there’s no problem calling this function on android.  Why doesn’t the simulator handle it (that’s what a simulator is meant to do isn’t it?)

thanks

We’ve added a parser to make sure build.settings has things we are looking for. It’s possible that we don’t have that check exactly right. I’ll let engineering know and they can address the false positive. This is just warning and you can ignore it for the time being.

Rob

Can you PM me the build.settings file that causes the “incorrect capitalization” warning?  I’m not getting it with the Facebook project in the CoronaSDK Samples which has the same spelling of “facebookAppId” as you show above.

Also, if you delete the plugin_facebook_v4.lua in the /Users/[YOUR_USERNAME]/Library/Application Support/Corona/Simulator/Plugins directory and reload your project using the Facebook-v4 plugin, the simulator should download a new stub Lua file which addresses the issue you were having with facebook.isFacebookAppEnabled().

Hi Perry, I don’t seem to be able to reproduce the illegal capitalisation warning any more.

Which is the correct one to use?

thanks

In the settings.iphone.plist table it’s:  FacebookAppID

In the settings.android table it’s: facebookAppId

See: https://docs.coronalabs.com/plugin/facebook-v4/index.html

Rob

how strange, I got the incorrect capitalisation warning again (without changing anything!!).

I’ve noticed where I went wrong though, it was a capital D on the end

22:03:12.604  WARNING: unrecognized key: settings.android.facebookAppID (string) (incorrect capitalization)

Its the last capital D. For iOS the last D is capital. For Android it’s a lower case ‘d’. If it helps, copy and paste from what I typed in above. It’s directly from the documentation.

Rob