Search code examples
linkerfacebook-ios-sdkappstore-approvalidfa

Facebook iOS SDK links unwanted AdSupport library


TL;DR: Adding the latest Facebook iOS SDK to a new, empty project puts AdSupport in the link table. AdSupport provides the ASIdentifierManager, which provides the IDFA. For a kids' app, this means automatic rejection. My question is: is it possible to stop this transitive use of tracking?

Details

One can find lots of copies of the sentence “[T]he Facebook SDK does not require AdSupport.framework to be included.” But they do not say how to stop the compiler from adding it to the link table. It looks like Facebook is trying to force us to track, whether we want to or not. The number of appearances of "ASIdentifierManager" is growing:

- SDK 7: 13 appearances
- SDK 9: 30
- SDK 11: 66

To Reproduce

(Short)

  1. Add the SDK via SPM.
  2. Run otool on the resulting executable and observe
    Load command 18
             cmd LC_LOAD_DYLIB
         cmdsize 88
            name /System/Library/Frameworks/AdSupport.framework/AdSupport

(Long)

  1. Start with a one-page empty app, call it TestFBSDK
  2. Add dependency to https://github.com/facebook/facebook-ios-sdk.git using Swift Package Manager
  3. Do not import or use the SDK
  4. Build an app Archive for "Any iOS Device"
  5. Find the new archive in the Archives pane of the Organizer window.
  6. Right-click on the archive entry and choose Show in Finder.
  7. Right-click on the archive file and choose Show Package Contents.
  8. Navigate to the Products/Applications/ folder.
    • It contains the .app file.
  9. Open the Terminal, type cd and drag the app icon to the terminal window.
    • You will get something like cd /.../Library/Developer/Xcode/.../TestFBSDK.app
  10. Hit Enter to change directories
  11. Run the command
    • otool -l TestFBSDK | grep AdSupport -A 3 -B 3
  12. Run the command
    • nm TestFBSDK | grep ASIdentifierManager

See Also

There are plenty of posts on this from ten years ago but I see nothing current.


Solution

  • In the interim, some people have experimented with commenting or ifdef-ing out parts of the Facebook SDK. The problem is how far to pursue the transitive closure of your edits.

    Here is a link to a minimal set of diffs that worked for me. That is, the executable had no AdSupport or ASIdentifierManager references.

    https://github.com/snorrsi/facebook-ios-sdk/commit/9d69d9ab0e510359311085def696c750c345037a