Login opens Safari, not Facebook app, on iOS and doesn't authorise correctly

I’m looking for errors when you run the app, not when  you build it.

Hi!

No problem, the second, smaller log is directly from the Corona Simulator Console when I run the app. Logging into FB is one of the first things that the apps tries to do, if the user has already used it to sign in before, so the 6-7 log entries I put in my last entry are all I see before the app tries to log into FB and, as a result, switches out to Safari with the problem I mentioned …

If you’re looking for the full log from XCode, rather than from the simulator console, it’s this … Obviously most of this is debug code on my part, but this is the full log from the point of launching the app, up until it switches to Safari when attempting the FB login.

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s SpringBoard[58] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s SpringBoard[58] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s kernel[0] <Notice>: xpcproxy[4077] Container: /private/var/mobile/Containers/Data/Application/C768A511-939B-4F1E-B26D-D8D64BEE26C4 (sandbox)

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: Platform: iPhone / iPhone8,1 / 9.3.1 / Apple A9 GPU / OpenGL ES 2.0 Apple A9 GPU - 77.14 / 2016.2830 / en-AU | AU | en_AU | en

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: CONFIG: iPhone5+

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: Lua Patch::activating patch ‘table-pop’

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: PURCHASES

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: -----------------------

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: -----------------------

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: Unlocking ATMOS: champagne

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: Unlocking ATMOS: snow

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: Unlocking THEME: snow

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: Unlocking ATMOS: rain

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: Flurry: Starting session on Agent Version [Flurry_iOS_123_4.3.2] 

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: luaopen_CoronaProvider_ads_admob

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: WARNING: ads.init() was already called for admob.

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: — DEBUG: Loaded Set: rc.theme.default.textures.mainMenuSet0

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: — DEBUG: Loading Sheet: mainMenuSet0.png

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: — DEBUG: Loading ThemedImageSheet: rc/theme/default/textures/mainMenuSet0.png

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: — DEBUG: Loading Sheet: mainFont.png

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: — DEBUG: Loading ThemedImageSheet: rc/fonts/mainFont.png

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s gamed[145] <Warning>: Application(com.tnsoftware.Project) is not allowed to run in production

Apr 11 07:27:20 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: — DEBUG: Loading stream: rc/music/menuLoop1.mp3

Apr 11 07:27:21 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: Unbalanced calls to begin/end appearance transitions for <AppViewController: 0x154e44e80>.

Apr 11 07:27:22 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: — DEBUG: initGC -------------

Apr 11 07:27:22 Simon-Michelmores-iPhone-6s Project[4077] <Warning>: — DEBUG: -------------

Apr 11 07:27:24 Simon-Michelmores-iPhone-6s com.apple.xpc.launchd[1] (com.apple.WebKit.WebContent.F77F426C-E4C1-4C3A-9BFA-674D2158007D[4075]) <Warning>: Service exited with abnormal code: 1

In further, more curious news, if I take the example Facebook app that comes with the Corona SDK (from “SampleCode/Networking/Facebook”) and change it’s Facebook App ID to the ID for my app … I get exactly the same behaviour.

As in, it opens up Safari, not the Facebook application, and tells me that I’ve already authorised the app.

Hello Simon.

Thanks for the report.

I’ll look into this.

Danny did you get anywhere with this?  I am seeing the exact same behavior.  Updated my xcode to the latest version and am using daily build 2865 but its still launching safari.  A couple of days ago it was opening the facebook app and as far as I am aware have changed nothing relating to this, just made another build a few days later and its changed!  

Get the same linking error during build but no errors in the terminal when running the app.  Everything works but it requires the user to OK the “you already authorised…” message vs doing nothing :frowning:

I’ve got the exact same behaviour here. Before, it used to open the Facebook App on iOS but it changed several weeks ago. Is there any known solution to this issue ?

Not that I’ve found yet, no. :frowning:

Would be nice to hear something from the Corona team about it  :wink:

Same here

It looks like Apple is forcing Facebook to use a Safari View Controller for this. Please see:

https://developers.facebook.com/blog/post/2015/10/29/Facebook-Login-iOS9/

I’m asking our engineers to make sure the login via SVC is working as expected.

Rob

Thanks for the update!

Yes indeed, glad you engineers are working on it.

Please do let us know when they have updated it :slight_smile:

Hey everyone,

 

The Facebook-v4 (now known as simply “Facebook”) plugin is now out of beta:

https://coronalabs.com/blog/2016/10/28/facebook-plugin-update-we-are-out-of-beta/

 

And with that we’ve made some changes to how iOS apps interact with the Facebook app.

 

For iOS 8 and lower, if the Facebook App is installed on the device, a “Fast-App-Switch” will occur when logging in and using the Share Dialog.

 

On iOS 9 and above, Facebook changed the default login behavior to use a SafariViewController regardless of whether the Facebook App is installed or not. To be consistent with this, we’ve made the Share Dialog use a SafariViewController in all cases on iOS 9 and above.

 

Consult the new Facebook Versioning/Upgrade guide for more info:

https://docs.coronalabs.com/plugin/facebook-v4/fbUpgrade.html#update-stable-release

Hey everyone,

 

The Facebook-v4 (now known as simply “Facebook”) plugin is now out of beta:

https://coronalabs.com/blog/2016/10/28/facebook-plugin-update-we-are-out-of-beta/

 

And with that we’ve made some changes to how iOS apps interact with the Facebook app.

 

For iOS 8 and lower, if the Facebook App is installed on the device, a “Fast-App-Switch” will occur when logging in and using the Share Dialog.

 

On iOS 9 and above, Facebook changed the default login behavior to use a SafariViewController regardless of whether the Facebook App is installed or not. To be consistent with this, we’ve made the Share Dialog use a SafariViewController in all cases on iOS 9 and above.

 

Consult the new Facebook Versioning/Upgrade guide for more info:

https://docs.coronalabs.com/plugin/facebook-v4/fbUpgrade.html#update-stable-release