facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
https://developers.facebook.com/docs/ios
Other
7.78k stars 3.54k forks source link

Can't verify that LDU mode is working. #1446

Closed nservidio closed 3 years ago

nservidio commented 4 years ago

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

Goals

What do you want to achieve?

Sorry, I may be missing something simple here!

I'd like to be able to verify that adding:

Settings.setDataProcessingOptions(modes: ["LDU"], country: 0, state: 0)

to my code is correctly "limiting data use".

See https://developers.facebook.com/docs/marketing-apis/data-processing-options

Expected Results

Expected to see some "ldu" or "data_processing_options" parameter in the graph response or request.

Actual Results

Didn't see an "ldu" or "data_processing_options" parameter in the graph response or request.

Steps to Reproduce

  1. Launch iOS app.
  2. Monitor network traffic in Charles Proxy.
  3. examine graph.facebook.com requests

Code Samples & Details

See Goals section.

nservidio commented 4 years ago

I also tried adding the following code snippet:

Settings.loggingBehaviors = [.appEvents, .graphAPIDebugInfo, .informational, .networkRequests]
Settings.setDataProcessingOptions([SharedConstants.limitedDataUse], country: 0, state: 0)
ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
DispatchQueue.main.asyncAfter(deadline: .now() + 30) {
    print("Should we limit? \(Settings.shouldLimitEventAndDataUsage)")
}

I ran the app in a simulator with location simulating San Francisco, CA I got plenty of logs, but nothing related to LDU mode. I'm not sure if shouldLimitEventAndDataUsage is related to "LDU" mode, but I got:

Should we limit? false
joesus commented 4 years ago

@nservidio - I see it in the post parameters if I breakpoint on https://github.com/facebook/facebook-ios-sdk/blob/78b1ece19e315ef2178844fab9de8db5f88b195b/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m#L1295-L1296

Do you see it there?

I'm not sure if shouldLimitEventAndDataUsage is related to "LDU" mode

This is unrelated. Based on flag limitEventAndDataUsage. According to the docs:

Gets whether data such as that generated through FBSDKAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches.
joesus commented 3 years ago

Seems resolved.