Facebook plugin v4.

I’m trying to implement facebook in my game for highscore comparison between friends but I can’t make it work. I have corona sdk enterprise and I’m following the steps for android in https://docs.coronalabs.com/plugin/facebook-v4/index.html , I am stuck at this steep.

 

If you’re using Corona Enterprise for Android, you’ll need to make the following configuration changes to your Android project:

  1. Open the project.properties file in your Enterprise template project and add the following library reference:

Where is project.properties file located can someone help?

This is my build.settings code:

-- For more information on build.settings see the Corona SDK Build Guide at: -- https://docs.coronalabs.com/guide/distribution/buildSettings -- settings = { plugins = { ["plugin.facebook.v4"] = { publisherId = "com.coronalabs" }, }, orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "portrait", supported = { "portrait", }, }, excludeFiles = { -- Include only the necessary icon files on each platform iphone = { "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-Small-\*.png", "Icon\*@2x.png", }, }, -- -- iOS Section -- iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay UIApplicationExitsOnSuspend = false, -- uncomment to quit app on suspend CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-167.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, }, }, -- -- Android Section -- android = { usesPermissions = { facebookAppId = "192296831202321" "android.permission.INTERNET", }, }, }

but when i include facebook in my main.lua:

local facebook = require( "plugin.facebook.v4" )

I get this error:

?:0: attempt to call a nil value stack traceback: ?: in function 'require'

Just to make sure, are you doing Simulator builds or are you using Xcode to do Enterprise builds?

Enterprise doesn’t use build.settings. You have to download the Enterprise plugins and drag the Facebook plugin into your project, making sure to choose the “Copy” option. Enterprise doesn’t look at build.settings. 

Now the error is complaining about a nil being passed to a require statement. The require you have is passing a string, so I’m suspecting that’s not the issue. Do you have other “require” statements? Can you post that code?

Thanks

Rob

I have Corona free not Enterprise and I use Corona simulator to build.

Do I need to buy Corona Enterprise to implement facebook? If yes can you tell me the steps on how to implement facebook.

Thank you in advance!

I think you’re in the right place in the docs. You just have to skip that part since you’re not using Enterprise.

There are two other useful guides here under “Social”:  https://docs.coronalabs.com/guide/index.html#communication-social

Rob

Just to make sure, are you doing Simulator builds or are you using Xcode to do Enterprise builds?

Enterprise doesn’t use build.settings. You have to download the Enterprise plugins and drag the Facebook plugin into your project, making sure to choose the “Copy” option. Enterprise doesn’t look at build.settings. 

Now the error is complaining about a nil being passed to a require statement. The require you have is passing a string, so I’m suspecting that’s not the issue. Do you have other “require” statements? Can you post that code?

Thanks

Rob

I have Corona free not Enterprise and I use Corona simulator to build.

Do I need to buy Corona Enterprise to implement facebook? If yes can you tell me the steps on how to implement facebook.

Thank you in advance!

I think you’re in the right place in the docs. You just have to skip that part since you’re not using Enterprise.

There are two other useful guides here under “Social”:  https://docs.coronalabs.com/guide/index.html#communication-social

Rob