facebook / facebook-sdk-for-unity

The facebook sdk for unity.
https://developers.facebook.com/docs/unity
Other
490 stars 257 forks source link

SDK sends events automatically even when disabled #684

Open MartinVavrek opened 1 year ago

MartinVavrek commented 1 year ago

Checklist

Environment

Goals

I would like to postpone sending events till player gives gdpr consent.

Expected Results

SDK will not send auto events right after startup.

Actual Results

SDK sends auto events after startup.

Steps to Reproduce

  1. Install SDK
  2. setup proper app id and disable "Auto Logging App Events"
  3. Build
  4. run the game connected to some proxy
  5. observe requests to graph.facebook.com

Code Samples & Details

This is plist generated for iOS application ` FacebookAdvertiserIDCollectionEnabled

<key>FacebookAutoLogAppEventsEnabled</key>
<false />
<key>FacebookAutoInitEnabled</key>
<false />`

Before calling FB.Init , in proxy we can see multiple requests to graph.facebook.com. Same behaviour is observed on Android as well. This was observed in 14.1 version and it is same when using 16.0

JordiFB commented 1 year ago

Hi @MartinVavrek, could you send us a detailed list of these requests or a log file to review these requests to graph.facebook.com?

Thank you so much in advance for your help

MartinVavrek commented 1 year ago

Hello @JordiFB , here are all the requests: Flow Details.txt

JordiFB commented 1 year ago

Hi @MartinVavrek, thank you for your report. We have resolved the issue with requests sent to Facebook before FB.init is called. Please update to the newest release of the SDK v16.0.1 to have this change applied.

markhetheringtonmc commented 1 year ago

We are still seeing calls to graph.facebook.com before consent. Attached is a capture of the calls before our consent dialog and before we initialize the SDK

This is with Unity SDK version 16.0.2 and Unity version 2021.3.27f1 and 2021.3.31f1

IMG_2064

markhetheringtonmc commented 1 year ago

Callstack of the issue: 0 0x18c935620 [0x18c6c6000 + 2553376] CFNetwork
1 -[FBSDKURLSessionTask start] [0x100a98000 + 48160] FBSDKCoreKit_Basics
2 55-[FBSDKURLSession executeURLRequest:completionHandler:]_block_invoke [0x100a98000 + 47088] FBSDKCoreKit_Basics
3 -[FBSDKURLSession updateSessionWithBlock:] [0x100a98000 + 47312] FBSDKCoreKit_Basics
4 -[FBSDKURLSession executeURLRequest:completionHandler:] [0x100a98000 + 46808] FBSDKCoreKitBasics
5 -[FBSDKGraphRequestConnection start] [0x1014f4000 + 167700] FBSDKCoreKit
6 -[FBSDKServerConfigurationManager loadServerConfigurationWithCompletionBlock:] [0x1014f4000 + 287412] FBSDKCoreKit
7 -[FBSDKServerConfigurationManager cachedServerConfiguration] [0x1014f4000 + 287200] FBSDKCoreKit
8 GraphRequestPiggybackManager.addServerConfigurationPiggyback(to:) [0x1014f4000 + 587964] FBSDKCoreKit
9 GraphRequestPiggybackManager.addPiggybackRequests(
:) [0x1014f4000 + 586016] FBSDKCoreKit
10 @objc GraphRequestPiggybackManager.addPiggybackRequests(_:) [0x1014f4000 + 589136] FBSDKCoreKit
11 -[FBSDKGraphRequestConnection start] [0x1014f4000 + 167700] FBSDKCoreKit
12 +[FBSDKGateKeeperManager loadGateKeepers:] [0x1014f4000 + 154536] FBSDKCoreKit
13 FeatureManager.check(:completionBlock:) [0x1014f4000 + 775544] FBSDKCoreKit
14 @objc FeatureManager.check(:completionBlock:) [0x1014f4000 + 776348] FBSDKCoreKit
15 ApplicationDelegate.initializeSDK(launchOptions:) [0x1014f4000 + 432812] FBSDKCoreKit
16 ApplicationDelegate.application(:didFinishLaunchingWithOptions:) [0x1014f4000 + 433988] FBSDKCoreKit
17 @objc ApplicationDelegate.application(
:didFinishLaunchingWithOptions:) [0x1014f4000 + 447964] FBSDKCoreKit
18 -[FBUnityInterface didFinishLaunching:] [0x1080e4000 + 2070604] UnityFramework /users/myproject/iOS/Libraries/FacebookSDK/SDK/Editor/iOS/FBUnityInterface.mm:65
19 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER [0x18b601000 + 195556] CoreFoundation
20 _
CFXRegistrationPost_block_invoke [0x18b601000 + 194024] CoreFoundation
21 _CFXRegistrationPost [0x18b601000 + 193488] CoreFoundation
22 _CFXNotificationPost [0x18b601000 + 190468] CoreFoundation
23 -[NSNotificationCenter postNotificationName:object:userInfo:] [0x18a59c000 + 178056] Foundation
24 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] [0x18d814000 + 2172868] UIKitCore
25 -[UIApplication _runWithMainScene:transitionContext:completion:] [0x18d814000 + 2170744] UIKitCore
26 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] [0x18d814000 + 2170520] UIKitCore
27 _UIScenePerformActionsWithLifecycleActionMask [0x18d814000 + 1632536] UIKitCore
28 101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke [0x18d814000 + 2186708] UIKitCore
29 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] [0x18d814000 + 1289376] UIKitCore
30 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] [0x18d814000 + 1283476] UIKitCore
31 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] [0x18d814000 + 1282148] UIKitCore
32 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke [0x18d814000 + 1281944] UIKitCore
33 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] [0x18d814000 + 1281108] UIKitCore
34 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion [0x18d814000 + 1279708] UIKitCore
35 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] [0x18d814000 + 1278768] UIKitCore
36
64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.225 [0x18d814000 + 4945432] UIKitCore
37 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] [0x18d814000 + 1275160] UIKitCore
38 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] [0x18d814000 + 1274732] UIKitCore
39 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] [0x18d814000 + 2433496] UIKitCore
40 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] [0x18d814000 + 2433100] UIKitCore
41 -[FBSScene _callOutQueue_didCreateWithTransitionContext:completion:] [0x1a3707000 + 59748] FrontBoardServices
42 92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.108 [0x1a3707000 + 59436] FrontBoardServices
43 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] [0x1a3707000 + 54528] FrontBoardServices
44
92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke [0x1a3707000 + 102912] FrontBoardServices
45 _dispatch_client_callout [0x19352b000 + 17132] libdispatch.dylib
46 _dispatch_block_invoke_direct [0x19352b000 + 31788] libdispatch.dylib
47 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK [0x1a3707000 + 39352] FrontBoardServices
48 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] [0x1a3707000 + 39036] FrontBoardServices
49 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] [0x1a3707000 + 38952] FrontBoardServices
50 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION [0x18b601000 + 228016] CoreFoundation
51 CFRunLoopDoSource0 [0x18b601000 + 224408] CoreFoundation
52
CFRunLoopDoSources0 [0x18b601000 + 218120] CoreFoundation
53 __CFRunLoopRun [0x18b601000 + 212732] CoreFoundation
54 CFRunLoopRunSpecific [0x18b601000 + 211896] CoreFoundation
55 GSEventRunModal [0x1ce0f6000 + 13640] GraphicsServices
56 -[UIApplication _run] [0x18d814000 + 2289540] UIKitCore
57 UIApplicationMain [0x18d814000 + 2287588] UIKitCore
58 -[UnityFramework runUIApplicationMainWithArgc:argv:] [0x1080e4000 + 97812] UnityFramework /users/myproject/iOS/Classes/main.mm:96

markhetheringtonmc commented 1 year ago

It seems Facebook is starting to send information on app launch finish rather than the init called from the game so is bypassing any attempt to obtain user consent first. Since this is in breach of Privacy legislation, it is an extremely high priority issue that needs immediate attention