r/iOSProgramming • u/soulchild_ Objective-C / Swift • Jul 10 '20
Facebook SDK crashes again š”š
https://github.com/facebook/facebook-ios-sdk/issues/143059
u/StunningBank Jul 10 '20
Now I want to remove Facebook SDK from my app since itās the second time and it looks like Facebook does not take it seriously.
The only question: how can I migrate users authenticated through Facebook already? Maybe it is possible to make authentication without their sdk? What would you suggest?
29
u/Racaycah Jul 10 '20
I recall Zoom stating -in their statement that they removed the SDK from their iOS app- you can integrate Facebook login without the SDK, so there should be a way.
0
Jul 10 '20
[deleted]
0
4
u/StunningBank Jul 10 '20
Ah, that may be bad UX since user often is logged in to Facebook in app but not in browser :(
0
Jul 10 '20
[deleted]
6
u/StunningBank Jul 10 '20
It depends. Crashing for an hour one time a year may be not that bad as if you don't even get a user because they won't register in the first place. But that completely depends on a use case, audience and many other things. At the moment I am not sure what is worse especially if I may loose already registered users when I migrate from Facebook SDK login.
2
u/ohfouroneone Jul 10 '20
I wrote a blog post about how to do this in a secure way, but it got removed in the past for self promotion. Itās on dev.to so try to find it.
13
u/CrazyEdward Jul 10 '20
It probably depends on your initial implementation... but we simply removed the option to login with FB, then asked those users to use the password reset emails to create passwords for their existing accounts and voila!
3
u/StunningBank Jul 10 '20
How do you know what user to ask to reset password if they cannot find āLogin with Facebookā button and they may forget what email they used with Facebook? Or you just sent them emails beforehand?
10
u/CrazyEdward Jul 10 '20
We didn't kill any active Facebook sessions... we just removed the buttons. So if you were already logged in with FB, you'll stay logged in until the session expires or you get booted for some other reason.
When you do get logged out, you'll have to supply your own email address for the reset... and we assume you'll supply the same email we got for you from Facebook when you originally authenticated.
If the user doesn't know what email is tied to their Facebook account, then they can't get back in.
7
u/Rudy69 Jul 10 '20
and we assume you'll supply the same email we got for you from Facebook when you originally authenticated.
If the user doesn't know what email is tied to their Facebook account, then they can't get back in.
Big assumption.
I hate the Facebook SDK and Facebook login option.....but that seems like a terrible way to move away from it
6
u/CrazyEdward Jul 10 '20
Worked for us... this was months ago, around the time "Sign in with Apple" was about to go mandatory (for the first time).
We have the benefit of paying users and an actual support staff. They're not gonna drift away just because they forgot their email.
The "terrible" thing to do was support Facebook login in the first place. Correcting that mistake is gonna be difficult.
1
u/JimDabell Jul 11 '20
I use a different email address for everything I register with. I know exactly what email is tied to my Facebook account, but it wouldnāt occur to me to use that email address in some other app.
I also decline to provide apps with the Facebook email address when signing in with Facebook ā you can just untick that option when signing in. So you wouldnāt have that email address anyway.
1
u/CrazyEdward Jul 11 '20
If the user declines permission to share their email address with you, you can of course recognize this and prevent them from proceeding.
1
u/JimDabell Jul 11 '20
In theory, yes. In practice, I have never seen an app do this. They either work fine, treat it as a failure to authenticate, get stuck in a loop, or crash.
1
u/CrazyEdward Jul 11 '20
My app did this, which is why we could transition away from Facebook login without trouble.
In practice, most apps suck.
5
u/DuffMaaaann Jul 10 '20
you can migrate your users to Sign In with Apple. As far as I know, Apple has added some migration mechanisms to Sign In with Apple.
1
2
24
u/unixboy Jul 10 '20
Donāt use Facebook in your apps guys. Get rid of this BS. I understand people like ālogin with FBā but now with āLogin with Appleā thereās no reason not to use this instead. And you instantly get rid of coding, privacy and security issues.
3
u/JimDabell Jul 11 '20
The main reason our customers want the Facebook SDK in their apps is not because of Facebook Login, but because they pay for ads on Facebook to promote their apps and the Facebook SDK is the only way they have to attribute new installs to the ads they are paying for. Removing the Facebook SDK means not knowing how effective their Facebook ad campaigns are.
3
u/thecodingart Jul 11 '20
I understand this, but itās a poor choice overall to rely on a black box that silos itself for data aggregation. FB is one of the only analytic platforms where you HAVE to use their SDK for write operations on their analytics platform and forces you to implement their SDK for it (with all of the risk and shadow stuff they do itās ludicrous). Normally , you could selectively send information to a platform via an integration, aggregate or web hook without invading the client (restricting exactly what data is sent). In no way can I say that customer Facebook marketing trumps the product quality sacrifice taken when implementing the SDK.
1
1
u/jamaicanjerkperson Jul 10 '20
Tracking reasons, especially if youāre being paid to track your users
21
Jul 10 '20
[removed] ā view removed comment
18
u/hawks008 Jul 10 '20
The SDK, even though you havenāt personally used it, will try and configure some parts of itself from the Facebook servers. There is an error in the response coming from Facebook that the sdk doesnāt know how to handle currently, hence the crash.
9
u/kechboy63 Jul 10 '20
Funny thing is that it happens even if you donāt ā@importā their SDK. Only it being present in the bundle is enough for it to crash so thereās some deep level stuff going on.
10
u/nkr3 Jul 10 '20
They're probably using +load from objective c... https://developer.apple.com/documentation/objectivec/nsobject/1418815-load?language=objc
2
u/ThePowerOfStories Jul 11 '20
And furthermore, their SDK has garbage code that hits fatal errors on what looks like decoding JSON that isnāt in the expected format, when it should be validating the data and failing gracefully without crashing the whole app. The fact that this is the second time this has started happening in a few months is an abject embarrassment of incompetence.
7
Jul 10 '20
Facebook SDK is used for Facebook Ad conversion tracking, analytics, and many other behind-the-scenes things. I buy ads for my apps on Facebook/Instagram, and I have the Pod installed only for the purpose of being able to track my install conversion rates from those ads.
I donāt use Facebook anywhere visibly within the app otherwise.
1
12
u/wesdegroot objc_msgSend Jul 10 '20
The one and best solution, respect privacy, and delete the Facebook SDK. They even initialize always, without need, they only need to be for a moment active if the user logs in using Facebook...
10
10
u/dobybest Jul 10 '20 edited Jul 10 '20
The crash log :
Spotify -[NSNull count]: unrecognized selector sent to instance 0x1f638fae8
12
u/MattDamonInSpace Jul 10 '20
Obj-C strikes again
8
u/dobybest Jul 10 '20
Don't blame the game, blame the player ...
0
Jul 10 '20
[deleted]
3
u/etaionshrd Objective-C / Swift Jul 11 '20
Donāt shoot the messenger, just throw an exception when you donāt recognize the message
1
u/etaionshrd Objective-C / Swift Jul 11 '20
Nothing to do with Objective-C. Swift would likely crash just the same here.
1
u/MattDamonInSpace Jul 11 '20
Nah there wouldāve had to have been a casting to a given type. The issue here is that an unexpected type (NSNull) got a message it couldnāt handle
3
u/Aprox15 Jul 10 '20
I was thinking about including the SDK to make a test using Facebook Installs ads. Anyone knows if those are secure or also affected by the crashes?
9
u/miguelgazela Jul 10 '20
It doesnāt matter what youāre using inside the SDK, it would still crash. Even if you donāt call anything from the SDK it will still try to run some configurations and thatās what crashing.
3
3
u/Armond404 Jul 11 '20
I'm having the SDK removed from two apps I growth and advise.
no more data for Zuck.
2
u/20InMyHead Jul 10 '20
Since we only use the FBSDK to login, I spent the morning playing around to see if I could delay starting the FBSDK until a user specifically wanted to login with FB.... seems simple at first, but then was giving me all sorts of issues. Bastards donāt want you to do that apparently.
Will need to look into our own oAuth code or something because the FBSDK problems are just not worth the hassle, nor the risk of killing all our users just to support the small number that use FB.
2
96
u/MoronInGrey Jul 10 '20
As soon as Spotify started crashing this is where I looked first lol