Facebook login on iOS always cancels the very first login attempt

Hi all,

I’m having a weird issue with the new Facebook v4 implementation in my Corona project. The issue is that whenever I try to login with Facebook on an iOS device after the first install it will always cancel the first login attempt.  (app is iOS only so haven’t tested this on Android).

the weird thing is all the following logins work perfectly fine. And the problem only occurs when the app is installed for the first time on a new device… So deleting the app and reinstalling it does not trigger the cancel issue.

Only times I can reproduce this issue is in either one of these cases:

  1. install the app on a new device (the app cannot be installed previously)

  2. change the app id (com.company.appname1, com.company.appname2 etc)

Also I think this issue only exists on iOS9, but I’m not 100% sure about this. I just wasn’t able to reproduce this issue on any iOS version below 9.

Did someone else notice this issue? And if so, is there a fix or workaround for this?

Any help is kindly appreciated!

Hello there.

I haven’t experienced this issue personally whilst testing. However, there will be a new Facebook plugin binary submitted today that will hopefully resolve some of these strange quirks.

We updated our system to build Facebook from source, so we can stay more up to date with their changes.

I’ll reply again when the plugin is submitted to our build server.

Thanks

The new Facebook v4 plugin binaries have been pushed up. It can take ~1hour to go live. 

So if you wouldn’t mind seeing if your issue is resolved after rebuilding in an hours time (an hour after this post), I’d appreciate it.

Thank you

I’m really struggling with the v4 plugins (iOS and Android) and I’ve no idea why since I’ve integrated lots of libraries before.

I’d already posted about my similar iOS issue here: https://forums.coronalabs.com/topic/61308-having-problems-getting-the-facebook-v4-ios-plugin-to-login-possibly-due-to-ats/

On iOS I always get the “loginCancelled” phase when I try and log in with the v4 plugin (it works fine using the old plugin).  

I’ve seen another post where someone said they called facebook.logout when this phase was triggered but that doesn’t work for me. In my plist file I have Allow Arbitrary Loads set to true. It actually seems like the request goes through, because as mentioned in my other post I added a launch url listener which appears to contain successful login info. I’m using a recent version of Enterprise (2886) and the Facebook library from the 2886 plugins folder.

As far as I can tell I’ve done everything that the docs describe, including the migration guide and yet it still says cancelled every single time.  

Another dev suggested removing the NSExceptionDomains from my plist, but that didn’t have any effect at all.

On Android everything builds and runs ok until I try to login, at which point I get an error telling me:

Class not found when unmarshalling: com.facebook.login.LoginClient$Request

Again I’ve posted this before but with no luck:

https://forums.coronalabs.com/topic/63324-android-studio-integration/

I’m taking a look at this today in case I’ve accidentally included an incorrect resource or something, but it’s concerning that I’m having so many problems with this plugin. Seemingly it works fine for everyone else so I’m not sure what I’m doing wrong.

We are aware of the login problem and hopefully we can get a resolution soon.

Rob

Phew, so it’s not just me doing something stupid then? That is somewhat of a relief tbh.

Hi Alan QuizTix,

In regards to the Android issue you encountered, I did find this little gem in the changelog for Facebook SDK 4.13.0:

Fixed

  • Fix activity leak in app events logger
  • Fix possible deadlock in AppEventsLogger
  • Fix %@ in translations
  • Fix Class not found when unmarshalling: com.facebook.login.LoginClient$Request
  • PR 476 - Fail fast on failure to find correct signature.

We’re still investigating other login-related issues on both platforms, but I thought I’d share that piece of news with you.

Same issue here,

Login facebook with iOS9, facebook_v4 plugin always return “loginCancelled”. 

This bug occur when login game with new facebook account which have not logged in before.

With the facebook account which login successfully with old facebook plugin, everything is normal with the v4 plugin.

For android, no error occurs.

Enterprise 2886.

***Update:

Getting everything work well with iOS9 by using the old facebook plugin

Waiting for the bug fixed from facebook v4 plugin!!!

Thanks for the update Ajay, this was driving me crazy. Is there a rough ETA on when we can expect fixes?

It would seem my loginCancelled issue is slightly different to yours yogamegroup, as I cannot login with any Facebook account regardless of whether it had previously logged in with the old plugin.

We’re currently working to get a new public release out, so it will be sometime after that.

Update:

Today we had an alert from Facebook for each of our apps:

Graph API v2.1 Upgrade Notice

 

QuizTix has been making recent API calls to Graph API v2.0, which will reach the end of the 2-year deprecation window on Monday, August 8, 2016. Please migrate all calls to v2.1 or higher in order to avoid potential broken experiences.

We recommend using our new Graph API Upgrade Tool to see which of your calls are affected by this change as well as any replacement calls in newer versions. You can also use our changelog to see the full list of changes.

When I go to the upgrade tool and select one of my apps I get this message: 

Your app hasn’t made enough calls to the Graph API to show any info, or there are no changes for the methods you selected between v2.0 and v2.6

Now I’m surprised if there aren’t enough calls to provide any data, so I’m wondering if the existing plugin is not calling any methods that are being deprecated in August. At any rate, I thought the deadline for upgrading the plugin was in October and not August.

Where does this leave us currently?

Hi Alan;

We received similar notices from Facebook today as well on two of our apps (about making calls to the deprecated Graph API v2.0).

Both of our apps are up-t-date using the plugin facebook.v4. It is about 45 days until Facebook’s cutoff.

So I am wondering about this too.

Steve

For those getting this message, the legacy Facebook plugin should be compile against a version that uses 2.1 end points. If your app is older, it may be compiled against a non-compliant SDK version. Simply rebuilding against the legacy plugin should address this, or you may need to make sure your API calls are explicitly calling newer end points.

Any old app will likely need updated.

As far as if you’re getting these messages against your apps using v4, could it be possible you have users who have not updated their apps?

Rob, do you happen to know of any way to check which end points are in use?  

If I download the latest Corona Enterprise plugins folder, and go into the Facebook folder (not Facebook-v4) will the facebook.jar and facebook_sdk.jar files in there be using 2.1 end points? I’ve had a quick look through the jars themselves but couldn’t see any mention of which end points were in use.  

The files say they were last updated on 10/12/2014, which seems like a long time ago, so hard to know if they’ll be sufficient or not.

Ajay told me yesterday that the current non-V4 plugin should be using 2.1 endpoints.

The Facebook SDK changelog for version 3.17 is where they started targeting Graph API v2.1:

iOS changelog: https://developers.facebook.com/docs/ios/change-log-3.x

Android changelog: https://developers.facebook.com/docs/android/change-log-3.x

The old Facebook plugin currently uses Facebook SDK 3.19 on iOS and 3.18 on Android.

Hi there,

Any news for the bugs with plugin facebook v4 with iOS9.

Thanks so much!!! 

I don’t have any more news other than we are trying to find the problem.

Rob

So as to not continue hijacking this thread from login problems, can we continue the discussion about the Graph API 2.0 email warnings on this thread:

https://forums.coronalabs.com/topic/63786-graph-api-v21-upgrade-notice/

Thanks

Rob

Now that the latest public build has been released, I just wondered if there is a rough ETA regarding the v4 login issues?