[Resolved] Facebook sign in works via mobile browser but not if Facebook App is installed

Guys…

a little help with the FB integration…

I am getting an error saying

the ios bundle is is missing from the apps Facebook IOS setting…

I have gone through and checked my FB app setting… its there… but can I clarify with you guys
what the actual Bundle ID in FB is…
are they talking about

  • Bundle Seed ID in Apple
  • Bundle Identifier (App ID Suffix) (I assume it was this)

help [import]uid: 67619 topic_id: 28437 reply_id: 128836[/import]

You’re bundle id is:

com.yourdomain.yourapp,

in my case for OmniTrivia, it’s:

com.omnigeekmedia.omnitrivia

You must also have a valid iTunes ID of a live app (doesn’t have to be this app) to fill into the iPad App Store ID and iPhone App Store ID. I have the two radio buttons Facebook Login and Deep Linking both selected.

Now on your side, of course you have to have your FacebookAppID for your calls, but you also have to have a URL schema in your build.settings that is “fb” + your FBAppID, i.e. fb1249389348939

Without that facebook’s app can’t manage the login and then pass control back to your app. [import]uid: 19626 topic_id: 28437 reply_id: 128841[/import]

Rob,
Thanks for that…

for my bundle id I have

bundleseesid.com.yourdomain.yourapp

I have updated that… to just com.yourdomain.yourapp

now… when I call FB… it seems like nothing happens… nothing gets called…

is there something like a dialog to come up and say… complete?

Vik [import]uid: 67619 topic_id: 28437 reply_id: 128843[/import]

In my build settings I had the word iphone in it… i got rid of it and now my build settings look like this

settings = {  
   
 plist = {  
 UIApplicationExitsOnSuspend = false,  
 CFBundleURLTypes =  
 {  
 {  
 CFBundleURLSchemes =  
 {  
 "fbXXXXXXXXXXXXXX",  
 }  
 }  
 }  
  
 }  
}  

so now… facebook gets opened … then a dialog is opened on top of it… but it is empty… it just hangs there
The code I am using is

local onFBTouch = function( event )  
 if event.phase == "release" then  
  
 local fbAppID = "XXXXXXXXXXXXX"  
  
 local facebookListener = function( event )  
 if ( "session" == event.type ) then  
  
  
 if ( "login" == event.phase ) then   
 facebook.request( "me/feed", "POST", {  
 message="Test Message",  
 name="Test App Name",  
 caption="Testing caption",  
 link="http://http://www.test.com/",  
 picture="http://www.test.com/assets/ck/thumb/1-b1477bc7e318b9b20d1c21cb6444e339.jpg" } )  
  
 end  
 end  
 end  
  
 facebook.login( fbAppID, facebookListener, { "publish\_stream" } )  
  
 end  
end  
  

any help [import]uid: 67619 topic_id: 28437 reply_id: 128845[/import]

If you want to take a screen shot of your facebook setup page and email it to me at

rob at omnigeekmedia dot com

I’ll see if I can spot something obvious.

Rob
[import]uid: 19626 topic_id: 28437 reply_id: 128849[/import]

anyone else with any pointers?

Rob gave me some good ideas… but unfortunately no luck…

I am using the latest stable build 894…

The very first time it runs… it asks for permissions… then goes back to my app… does not post anything
the next time I click the button to call FB nothing happenes

This is my build.settings file

settings = { iphone = { plist = { UIApplicationExitsOnSuspend = false, CFBundleURLTypes = { { CFBundleURLSchemes = { "fb449281835114436", } } } } } } [import]uid: 67619 topic_id: 28437 reply_id: 128871[/import]

the very first time I install it on my test device… it goes to FB does something quickly and then flips back to my app… subsequent times it does not go to FB at all… [import]uid: 67619 topic_id: 28437 reply_id: 128875[/import]

I think you’re working at some level.

The very first time you run it, it will flip to FB, ask you to approve your permissions and login and then it flips back to your app.

If more than 2 hours has elapsed, your authentication token has expired, so it will quickly flip to FB and right back as it re-logs you in.

If you are currently logged in, and your authtoken is less than 2 hours, you won’t see anything.
So now the question is why are you not posting and for that you’re going to have to get your prints working. See the email I just sent you. Basically for those who are running the stable build, iOS6 breaks Corona’s “print()” function. Starting around build 912, Corona SDK adds full support for iOS6 and the iPhone 5. Starting around build 919, they fix the prints showing up in the console.log.

If you are a subscriber and you want to build for iOS6 and the iPhone5, you have to run a daily build after 919. This has a requirement that you upgrade to the latest Xcode which should install the iOS6 SDK necessary to build these apps.

Rob
[import]uid: 19626 topic_id: 28437 reply_id: 128884[/import]

Guys…

a little help with the FB integration…

I am getting an error saying

the ios bundle is is missing from the apps Facebook IOS setting…

I have gone through and checked my FB app setting… its there… but can I clarify with you guys
what the actual Bundle ID in FB is…
are they talking about

  • Bundle Seed ID in Apple
  • Bundle Identifier (App ID Suffix) (I assume it was this)

help [import]uid: 67619 topic_id: 28437 reply_id: 128836[/import]

You’re bundle id is:

com.yourdomain.yourapp,

in my case for OmniTrivia, it’s:

com.omnigeekmedia.omnitrivia

You must also have a valid iTunes ID of a live app (doesn’t have to be this app) to fill into the iPad App Store ID and iPhone App Store ID. I have the two radio buttons Facebook Login and Deep Linking both selected.

Now on your side, of course you have to have your FacebookAppID for your calls, but you also have to have a URL schema in your build.settings that is “fb” + your FBAppID, i.e. fb1249389348939

Without that facebook’s app can’t manage the login and then pass control back to your app. [import]uid: 19626 topic_id: 28437 reply_id: 128841[/import]

Rob,
Thanks for that…

for my bundle id I have

bundleseesid.com.yourdomain.yourapp

I have updated that… to just com.yourdomain.yourapp

now… when I call FB… it seems like nothing happens… nothing gets called…

is there something like a dialog to come up and say… complete?

Vik [import]uid: 67619 topic_id: 28437 reply_id: 128843[/import]

In my build settings I had the word iphone in it… i got rid of it and now my build settings look like this

settings = {  
   
 plist = {  
 UIApplicationExitsOnSuspend = false,  
 CFBundleURLTypes =  
 {  
 {  
 CFBundleURLSchemes =  
 {  
 "fbXXXXXXXXXXXXXX",  
 }  
 }  
 }  
  
 }  
}  

so now… facebook gets opened … then a dialog is opened on top of it… but it is empty… it just hangs there
The code I am using is

local onFBTouch = function( event )  
 if event.phase == "release" then  
  
 local fbAppID = "XXXXXXXXXXXXX"  
  
 local facebookListener = function( event )  
 if ( "session" == event.type ) then  
  
  
 if ( "login" == event.phase ) then   
 facebook.request( "me/feed", "POST", {  
 message="Test Message",  
 name="Test App Name",  
 caption="Testing caption",  
 link="http://http://www.test.com/",  
 picture="http://www.test.com/assets/ck/thumb/1-b1477bc7e318b9b20d1c21cb6444e339.jpg" } )  
  
 end  
 end  
 end  
  
 facebook.login( fbAppID, facebookListener, { "publish\_stream" } )  
  
 end  
end  
  

any help [import]uid: 67619 topic_id: 28437 reply_id: 128845[/import]

If you want to take a screen shot of your facebook setup page and email it to me at

rob at omnigeekmedia dot com

I’ll see if I can spot something obvious.

Rob
[import]uid: 19626 topic_id: 28437 reply_id: 128849[/import]

so this is weird… I put print statements…

  
display.setStatusBar( display.HiddenStatusBar )  
  
local ui = require("ui")  
local facebook = require "facebook"  
  
local fbBtn  
local score = 100  
  
local onFBTouch = function( event )  
 if event.phase == "release" then  
  
print("test2")  
 local fbAppID = "MYIDHERE"  
  
 local facebookListener = function( event )  
 if ( "session" == event.type ) then  
 -- upon successful login, update their status  
  
 if ( "login" == event.phase ) then   
print("test3")  
 facebook.request( "me/feed", "POST", {  
 message="Test Message",  
 name="Test App Name",  
 caption="Testing caption",  
 link="http://http://www.foresightcreations.com/",  
 picture="http://www.foresightcreations.com/assets/ck/thumb/1-b1477bc7e318b9b20d1c21cb6444e339.jpg" } )  
 -- The "link" parameter can be the Android Market app link or a website URL of your choosing  
 end  
 end  
 end  
  
 facebook.login( fbAppID, facebookListener, { "publish\_stream" } )  
  
 end  
end  
  
print("test1")  
  
fbBtn = ui.newButton{  
 defaultSrc = "facebookbtn.png",  
 defaultX = 100,  
 defaultY = 100,  
 overSrc = "facebookbtn-over.png",  
 overX = 100,  
 overY = 100,  
 onEvent = onFBTouch,  
}  
  
fbBtn.x = 160; fbBtn.y = 160  
  

it prints all 3 statements… so it looks like everything is called… but FB is not posting… [import]uid: 67619 topic_id: 28437 reply_id: 128940[/import]

anyone else with any pointers?

Rob gave me some good ideas… but unfortunately no luck…

I am using the latest stable build 894…

The very first time it runs… it asks for permissions… then goes back to my app… does not post anything
the next time I click the button to call FB nothing happenes

This is my build.settings file

settings = { iphone = { plist = { UIApplicationExitsOnSuspend = false, CFBundleURLTypes = { { CFBundleURLSchemes = { "fb449281835114436", } } } } } } [import]uid: 67619 topic_id: 28437 reply_id: 128871[/import]

One thing that’s missing is your callback function for your request call.

function onRequestComplete( event )  
 --print("onRequestComplete: ", event.phase)  
 if event.isError then  
 print("Facebook request error: " .. event.response.error.message)  
 else  
 print("Success")  
 end  
end  
  
facebook.request("me/feed", "POST", obj, onRequestComplete)  

Now you’re building up your “obj” table just fine. But if there is an error, you won’t know it unless you use the call back and see what kind of error’s you’re getting.

[import]uid: 19626 topic_id: 28437 reply_id: 128951[/import]

the very first time I install it on my test device… it goes to FB does something quickly and then flips back to my app… subsequent times it does not go to FB at all… [import]uid: 67619 topic_id: 28437 reply_id: 128875[/import]

I think you’re working at some level.

The very first time you run it, it will flip to FB, ask you to approve your permissions and login and then it flips back to your app.

If more than 2 hours has elapsed, your authentication token has expired, so it will quickly flip to FB and right back as it re-logs you in.

If you are currently logged in, and your authtoken is less than 2 hours, you won’t see anything.
So now the question is why are you not posting and for that you’re going to have to get your prints working. See the email I just sent you. Basically for those who are running the stable build, iOS6 breaks Corona’s “print()” function. Starting around build 912, Corona SDK adds full support for iOS6 and the iPhone 5. Starting around build 919, they fix the prints showing up in the console.log.

If you are a subscriber and you want to build for iOS6 and the iPhone5, you have to run a daily build after 919. This has a requirement that you upgrade to the latest Xcode which should install the iOS6 SDK necessary to build these apps.

Rob
[import]uid: 19626 topic_id: 28437 reply_id: 128884[/import]

Rob,

Thanks for that I will try this and get back to you
Vik [import]uid: 67619 topic_id: 28437 reply_id: 129003[/import]

so this is weird… I put print statements…

  
display.setStatusBar( display.HiddenStatusBar )  
  
local ui = require("ui")  
local facebook = require "facebook"  
  
local fbBtn  
local score = 100  
  
local onFBTouch = function( event )  
 if event.phase == "release" then  
  
print("test2")  
 local fbAppID = "MYIDHERE"  
  
 local facebookListener = function( event )  
 if ( "session" == event.type ) then  
 -- upon successful login, update their status  
  
 if ( "login" == event.phase ) then   
print("test3")  
 facebook.request( "me/feed", "POST", {  
 message="Test Message",  
 name="Test App Name",  
 caption="Testing caption",  
 link="http://http://www.foresightcreations.com/",  
 picture="http://www.foresightcreations.com/assets/ck/thumb/1-b1477bc7e318b9b20d1c21cb6444e339.jpg" } )  
 -- The "link" parameter can be the Android Market app link or a website URL of your choosing  
 end  
 end  
 end  
  
 facebook.login( fbAppID, facebookListener, { "publish\_stream" } )  
  
 end  
end  
  
print("test1")  
  
fbBtn = ui.newButton{  
 defaultSrc = "facebookbtn.png",  
 defaultX = 100,  
 defaultY = 100,  
 overSrc = "facebookbtn-over.png",  
 overX = 100,  
 overY = 100,  
 onEvent = onFBTouch,  
}  
  
fbBtn.x = 160; fbBtn.y = 160  
  

it prints all 3 statements… so it looks like everything is called… but FB is not posting… [import]uid: 67619 topic_id: 28437 reply_id: 128940[/import]