Hi Rob,
I have taken the facebook sample app provided by corona as a basis to try and get integration working with no luck. Here is the details of what i have done.
-
Create a provisioning profile specifically for this test app. In this case net.pocketplayground.coronasampleapp
-
Create a new app in facebook developer portal
-
Add an “iOS” platform to the app in fb dev portal.Set the bundle ID to net.pocketplayground.coronasampleapp to match my provisioning profile. Specify the store id of an existing app (i just referenced one of my other apps that i have published). Enable SSO. Enable Deep Linking.
-
Left the other settings as default on the advanced and migrations page. (note: i wasnt sure about the “Native or Desktop app” setting, so i tried it both ways.
Advanced page with Native or Desktop disabled
Advanced page with Native or Desktop enabled
Migrations page
- Set the required app id fields in the sample app
In build settings
FacebookAppID = “645295625542769”, – replace XXXXXXXXX with your facebook appId
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
“fb645295625542769”, – replace XXXXXXXXX with your facebook appId
}
}
}
in main.lua
local appId = “645295625542769” – Add your App ID here (also go into build.settings and replace XXXXXXXXX with your appId under CFBundleURLSchemes)
local apiKey = nil – Not needed at this time
-
Compile the app using my coronasampleapp provisioning profile
-
Test the app using my iPad3 (iOS 5.1.1) which does not have the facebook app installed
Then when i click ok to return to the corona app, that just fails with this error (note the address bar)
- Test the app using my iPhone5 (iOS 6.0.2) which does have the facebook app installed
Same error, however pressing ok returns to the corona sample app correctly.
Note i am using the latest public release of Corona 2014.2189 (installed the (2189a) build on the mac).
So thats everything i did (based on the instructions in the links you provided). I have also attached the facebook sample app with the changes i made to the app id’s for your reference.
On a related note, a couple of doco and sample issues i noted.
A note re the instructions at http://docs.coronalabs.com/guide/social/setupFacebook/index.html. It says " iPhone App Store ID and/or iPad App Store ID is required for Facebook Single Sign-On. See the Build Settings (iOS) section below for further details", that Build Settings iOS link goes nowhere and there is no “Build Settings (iOS)” section below.
Another note re the facebook sample app that comes with corona, in main.lia where you get people to specify their app id
local appId = XXXXXXXXX – Add your App ID here (also go into build.settings and replace XXXXXXXXX with your appId under CFBundleURLSchemes)
It should really be local appId = “XXXXXXXXX” <-- note the quotes, as the facebook.login function requires a string, not a number. The original line indicates that it is a number, as you tell people to just replace the XXXXXXXX part with their id.
Please advise as I am complete stuck at the moment.
Cheers
Craig