News for hackers. Stuff that matters.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by andersco on Friday July 10, 2020 @07:39AM (#23790482)
How is it that a third party SDK is consistently causing apps to completely crash rather than, for example, displaying an error message? Is this a failure that cannot be caught? Sorry, just trying to understand. The dependency relationship just seems to be extreme.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by yreg on Friday July 10, 2020 @07:42AM (#23790510)
>To stop crashes from the Facebook SDK, some devs tried commenting out any code that calls Facebook. Nothing worked.

>It turns out that by just including the SDK with your app, Facebook runs hidden code on launch. (FBSDKApplicationDelegate.m)

[0] https://twitter.com/sandofsky/status/1258288056399847425

Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by harryf on Friday July 10, 2020 @07:54AM (#23790587)
... so if the app including the SDK has permission to access location data, the SDK could be passing that location data to Facebook?
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by akmarinov on Friday July 10, 2020 @07:57AM (#23790600)
Not only could it do that, but it also totally does do that
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by yreg on Friday July 10, 2020 @08:06AM (#23790656)
Didn't they also use to home in information about surrounding bluetooth devices? When iOS 13 beta dropped, half of the apps suddenly asked for bluetooth permissions because Google/FB SDKs attempted to use it on app launch.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by Nextgrid on Friday July 10, 2020 @08:31AM (#23790819)
Not sure about Bluetooth devices, but the Facebook SDK definitely phones home with some system data and generates an unique identifier on first launch which is then included every further interaction the SDK has. Both of these enable fingerprinting and persistent tracking.
[dead]
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by wolco on Friday July 10, 2020 @08:41AM (#23790890)
Why are people using the facebook sdk? What does it give them?
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by berkes on Friday July 10, 2020 @09:16AM (#23791140)
When we looked at it, we saw several reasons, all of which are dubious at best:

1. It is required for a "login with Facebook" feature, apparently. I'd presume this goes for other feautures that integrate with facebook, such as "invite from your friends" or "share on facebook(messenger)".

2. It gives access to metrics, when added to your own, greatly enrich your own data collection.

3. It is required when working with Facebook ads - though I would not know how this ties in with mobile apps: on web it is clearer (where you are required to host "the pixel" on your website in order to have ads on facebook link to that website.)

4. It is feature rich, so as a pure SDK, it offers neat utilities; though for each of these, there are better alternatives found in separate libs.

Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by harryf on Friday July 10, 2020 @09:57AM (#23791497)
Extending point 2, it’s essential if you’re running ads on Facebook and want to know if clicks on the ad in Facebook bring the user through to the app - ie so you can be sure you got a real conversion
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by yalok on Sunday July 12, 2020 @05:01AM (#23809980)
@harryf there’s a way to send ads attribution via server API, so no need to have client side FB SDK for that
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by mromanuk on Friday July 10, 2020 @09:10AM (#23791091)
I'm using it for realtime analytics (dashboard like mixpanel) also this brings authentication and other FB Integration
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by scarface74 on Friday July 10, 2020 @10:21AM (#23791709)
So yes the definition of “freedom” is “give the government more power over both app developers who voluntarily integrate the SDK and users who voluntarily download the app”.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by AlexandrB on Friday July 10, 2020 @01:51PM (#23794253)
> voluntarily

I don't remember apps listing the SDKs they use. As a humble user, how do I voluntarily choose whether to download an app or not based on their usage of Facebook's garbage?

Edit: You can't have it both ways. You can't remove a bunch of power and information from the user in the name of "safety" and "UX" and then claim that users are making a bunch of choices they can't possibly be informed about "voluntarily"

Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by scarface74 on Friday July 10, 2020 @01:53PM (#23794277)
In that case, pass laws forcing disclosure and you still let the users decide.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by layoutIfNeeded on Friday July 10, 2020 @07:56AM (#23790596)
Yes.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by speedyapoc on Friday July 10, 2020 @07:48AM (#23790543)
My guess in this particular instance is that it seems like the Facebook SDK is fetching some sort of remote serialized configuration, calling “count” on what it expects to be an array, and instead is calling it on NSNull (an object representing “null”) which is throwing an exception.

There are some intricacies on iOS surrounding null values and serialization, and as a developer it is important to understand that you may encounter NSNull. As a standard practice in my company, we type check every remote value before calling anything on it. Seems like that would have prevented this issue.

Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by AndrewZM on Friday July 10, 2020 @08:15AM (#23790718)
This is exactly what happens. Basically a null value is converted into an NSNull object and calling count on it will of course throw an exception... because there is no count method in that class...

It makes me wonder what all those engineers at FB are actually doing... ? Every time I tried to integrate or look into the FB SDK for simple functionality it was a total clusterfuck.

Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by x86_64Ubuntu on Friday July 10, 2020 @09:38AM (#23791337)
That's amateur hour stuff. Every developer in pretty much every language or platform learns VERY quickly what happens when you don't do a null check.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by blago on Friday July 10, 2020 @10:23AM (#23791739)
NSNull is not the null you think
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by x86_64Ubuntu on Friday July 10, 2020 @10:58AM (#23792124)
It may not be a conventional null, but I'm not aware of any tech where calling "count" on a Null, .nil? or otherwise null-like construct won't end horribly.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by plorkyeran on Friday July 10, 2020 @11:54AM (#23792813)
The Facebook SDK is written in obj-c, where calling `count` on `nil` is perfectly valid and returns 0. It only doesn't work on NSNull, which is a weird different thing that does not work like the language's built-in null.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by zentiggr on Friday July 10, 2020 @09:08AM (#23791076)
Sounds like a good reason to stop trying.

A bit of snark but also maybe stop trying to use a data collection engine to leverage anything for yourself?

Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by akmarinov on Friday July 10, 2020 @07:59AM (#23790608)
Could also be a string that’s no longer there

Source: have had that issue before

Also maybe it’s time for them to start rewriting things in Swift, where this would be much less likely to happen

Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by sciprojguy on Friday July 10, 2020 @08:15AM (#23790722)
True enough. Swift Codable with optional properties handles this automatically.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by nicoburns on Friday July 10, 2020 @07:42AM (#23790505)
I believe last time this happened it was because they were running code (including network requests) in a callback that gets called when they were loaded by the dynamic linker.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by iratewizard on Friday July 10, 2020 @07:52AM (#23790566)
I'm curious about this as well. I've always written frameworks to be used with a 'Policy Layer -> Mechanism Layer -> Utility Layer' general architecture. Each layer captures and does its best to handle errors in a way you would expect that layer to. The only time errors move up towards the policy layer is explicitly because the next layer up will handle it.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by rvz on Friday July 10, 2020 @07:51AM (#23790561)
Well SDKs may do their own initialization upon being loaded into the app which might be the cause here as the crash occurs on launch.
Re:App suddenly crashing on startup due to FBSDKRestrictiveD... by chooseaname on Friday July 10, 2020 @09:02AM (#23791031)
People are using third party code without fully understanding what they’re bringing in or the consequences of bringing it in.