Facebook library loading fail

Hi @ubj3d.android,

This was done because Apple started rejecting apps that got the advertising ID even if the app did not show any ads.

The docs are now updated on this point:

http://docs.coronalabs.com/api/library/facebook/index.html

Takre care,

Brent

So it is possible to be rejected by Apple only because using facebook ?

It shouldn’t be now, as a result of FB being pulled out into a plugin.

I think I"m having a similar issue (build  2014.2185, osx 10.9.1, iOS simulator 7.0 (463.9.4.2))

After I wasn’t able to get my app working, I tried to run the sample facebook app.  I changed the facebookAppID to mine.  I have the same problem as my app… black screen.

I also tried whammy’s suggestions of cut-n-pasting the plugins table above the other settings tables in build.settings.

Any ideas?  kirumbik - did you every figure out your issue?

Thanks!

Can you post your build.settings file?

local FacebookAppID = "111111111111111" settings = { orientation = { default = "portrait", supported = { "portrait"} }, plugins = { ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs", }, }, iphone = { plist = { UIStatusBarHidden = true, CFBundleShortVersionString = "0.2.24", CFBundleVersion = "0.0.5", CFBundleIdentifier = "com.myapp.dev", UIPrerenderedIcon = true, UIApplicationExitsOnSuspend = false, CFBundleDisplayName = "myapp", CFBundleIconFile = "Icon.png", MinimumOSVersion = "5.0", UIAppFonts = { }, FacebookAppID = FacebookAppID, CFBundleURLTypes = { { CFBundleURLSchemes = { "fb" .. FacebookAppID, }, }, }, CFBundleIconFiles = { "Icon.png" , "Icon-72.png", "Icon-512.png", "Icon@2x.png" }, }, components = {} }, android = { versionCode = "10", usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_COARSE\_LOCATION", "android.permission.CAMERA", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, usesFeatures = { { name = "android.hardware.location", required = false }, { name = "android.hardware.location.gps", required = false }, { name = "android.hardware.location.network", required = false }, { name = "android.hardware.camera", required = true }, { name = "android.hardware.camera.front", required = false }, }, intentFilters = { { label = "myapp", actions = { "android.intent.action.VIEW" }, categories = { "android.intent.category.DEFAULT", "android.intent.category.BROWSABLE", }, data = { scheme = "myapp" }, }, }, }, }

Bug after bug (sorry I am a bit mad, admob listener bug, webpopup, now this).

Added this to my build.settings

[“facebook”] = { publisherId = “com.coronalabs”, supportedPlatforms = { iphone = true }, [“iphone-sim”]=true},

but still getting the : Runtime error module facebook not found when I compile to XCode simulator.

That doesn’t look syntactically correct.  There should be another closing brace or the brace after iphone = true needs moved outward.

[“facebook”] = { publisherId = “com.coronalabs”, supportedPlatforms = { iphone = true , [“iphone-sim”]=true } },

Or something like that.

Rob

@gjaman that’s the problem… you are trying to add LUA code inside a build.settings (its not a LUA file)

remove the following:

local FacebookAppID = "111111111111111"

add this under plugins:

["facebook"]={ publisherId = "com.coronalabs", supportedPlatforms = { iphone = true }, }, 

and fix the following under iphone plist with:

FacebookAppID="XXXXXXXXXXXXX", FacebookDisplayName="Name of Your App", CFBundleURLTypes={{CFBundleURLSchemes={"fbXXXXXXXXXXXXX"}}}, ["URL types"]={ ["Item 0"]={ ["URL Schemes"]={ ["Item 0"]="fbXXXXXXXXXXXXX" }, }, },

I just added that lua code recently after reading this thread:

http://forums.coronalabs.com/topic/44603-facebook-issues/#entry232460

I tried your suggestions this morning and still a no go.  I also can’t get the sample facebook app to work.  I would have thought that should work out of the box with just replacing the facebookAppID

I must be missing something simple…

Hi Rob,

sorry I did not copy/paste it right.

Here is how it looks like in build.settings:

    plugins =         {         ["facebook"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone = true }, ["iphone-sim"]=true},          },   

So it is not a syntax error causing the error.

Regards,
Damir.

Do you get this when you build for a device instead of the Xcode simulator?

What version of Corona SDK are you building with?
 

It works on the devices (iPhone, iPad).

Corona build: 2189 (with the fix for XCode simulator)

My suggestion is to test the sample app and put your AppID in the places where it’s expected.  Use the build.settings as the sample app has them (other than adding your appID) and add your appID to the right place in the Lua code and try it.

You also have to make sure all of your setup on the Facebook side is correct.

Can you run the Console app and see if there are other messages in the log file?

Rob

This actually still looks incorrect.  You have a } after iphone = true that closes the supportedPlatforms table.

I reviewed all settings again.  It looks like everything is correct.  It still does not work in the simulator, but it does work on the device.

In the simulator I get a black screen.  The new facebook plugin works in the iOS simulator right? 

Facebook has never worked on the simulator.  The plugin shouldn’t black screen you on the Sim through.  Look for errors in your console log.

Rob

Uh??? Facebook does work on the iOS Sim - just not the Corona Simulator?!?

Well it seems to for me at least.

It’s been a while since I debugged my facebook module… I swear I used to use the iOS Sim to debug.  

I"m aware it never worked in corona sim. 

recap:

Corona simulator = no black screen, see the sample app, but unable to connect to facebook (as expected)

iOS simulator = black screen.  

Device = no black screen, able to connect to facebook (works as expected)