Facebook Login Window Closes

#1

Hello,

When trying to use Expo.Facebook.logInWithReadpermissionsAsync, I can get the FB login to popup, but it immediately closes before I can type in an email/password. When running this from my own server with a minimal ‘exp init’ app I get an error which says “Possible unhandled promise rejection…”.

I made this snack: https://snack.expo.io/rk_gQem8M which has the same behavior, minus the error. It runs fine in the preview tool, but running that snack in the expo client on my iPhone I get the same behavior of the login prompt flashing up for a moment then disappearing.

Has anyone experienced this or know how to fix it?

Thanks!

0 Likes

#2

I have been able to get around this, but maybe this should be opened on the repo as something that needs to change to improve the experience. I still have no idea why, but something about my local network was causing this. After moving from my wifi to cellular network all works as expected. Is this a problem of the Expo SDK not handling network related failures gracefully with the built in FB integration?

My first assumption was that the ‘possible unhandled promise rejection’ meant something was wrong in code like having a try with no catch somewhere. After several hours of digging and trying different barebones examples, it eventually dawned on me that maybe it is actually getting a rejection and not behaving well. I had read on a SO question at some point that a network issue had caused someone to run into this issue but my wifi was functioning just fine, so it wasn’t until I exhausted any other ideas that I tried moving from wifi to cellular, which of course worked immediately.

Could Expo handle a network related failure with something that is more of a direct error message? Did I just miss something that others get intuitively that would have got them to this point? I was basically taking shots in the dark when I found my solution.

0 Likes

#3

Hi there! Like you I was also experiencing an issue using the Facebook Login, not exactly the same one. The following error was appearing: “Possible Unhandled Promise Rejection (id:0)”. See below:

After scratching my head for a while I did some thinking and remembered that I installed Pi-Hole on my Raspberry Pi that’s on my network, it currently works as a DHCP Server and Ad Blocker. I did a test, disabled the Ad Blocking temporarily and presto! The Facebook Login was working again.

So, it would appear that some vital network request is being blocked and needs to be whitelisted. When I figure which one, I’ll post back a reply. Hopefully this might help yourself or somebody else having this issue.

0 Likes

#4

Thanks for the details. I’ve created an internal issue to track this.

1 Like

#5

jmmarco, shortly after writing my follow up post I actually came to the same conclusion that it was my Pi-hole.

I finally got around to testing it, and strangely, it appears the domain causing the issues is googleads.g.doubleclick.net . I’d be very curious to find out why a google ad page is being called to when using Expo.Facebook hook.

0 Likes

#6

Hi Tyler! Glad we could figure out that Pi-Hole was the culprit. I tried Whitelisting the graph API request. But that did not work. So, for now I’m still disabling Pi-Hole to test my App. I’ll take a look at the googleads domain you mentioned to see if I can figure something out.

0 Likes

closed #7

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

0 Likes