-
Notifications
You must be signed in to change notification settings - Fork 1
feat: derive Google Ads consent from a TCF CMP [LIN-2078] #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Shofiya2003
wants to merge
3
commits into
main
Choose a base branch
from
lin-2078-flutter-tcf-consent
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:flutter/services.dart'; | ||
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:linkrunner/linkrunner.dart'; | ||
|
|
||
| void main() { | ||
| TestWidgetsFlutterBinding.ensureInitialized(); | ||
|
|
||
| const channel = MethodChannel('linkrunner_native'); | ||
| final calls = <MethodCall>[]; | ||
|
|
||
| setUp(() { | ||
| calls.clear(); | ||
| TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger | ||
| .setMockMethodCallHandler(channel, (call) async { | ||
| calls.add(call); | ||
| return null; | ||
| }); | ||
| }); | ||
|
|
||
| tearDown(() { | ||
| debugDefaultTargetPlatformOverride = null; | ||
| TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger | ||
| .setMockMethodCallHandler(channel, null); | ||
| }); | ||
|
|
||
| group('enableTCFConsentCollection', () { | ||
| test('forwards the flag to the native SDK on iOS', () async { | ||
| debugDefaultTargetPlatformOverride = TargetPlatform.iOS; | ||
|
|
||
| await LinkRunner().enableTCFConsentCollection(true); | ||
|
|
||
| expect(calls, hasLength(1)); | ||
| expect(calls.single.method, 'enableTCFConsentCollection'); | ||
| expect(calls.single.arguments, {'enabled': true}); | ||
| }); | ||
|
|
||
| test('defaults to enabling collection', () async { | ||
| debugDefaultTargetPlatformOverride = TargetPlatform.iOS; | ||
|
|
||
| await LinkRunner().enableTCFConsentCollection(); | ||
|
|
||
| expect(calls.single.arguments, {'enabled': true}); | ||
| }); | ||
|
|
||
| test('forwards a disable call', () async { | ||
| debugDefaultTargetPlatformOverride = TargetPlatform.iOS; | ||
|
|
||
| await LinkRunner().enableTCFConsentCollection(false); | ||
|
|
||
| expect(calls.single.arguments, {'enabled': false}); | ||
| }); | ||
|
|
||
| // The native Android SDK supports TCF from 4.2.0, so Android goes through the | ||
| // same method channel handler as iOS. | ||
| test('forwards the flag to the native SDK on Android', () async { | ||
| debugDefaultTargetPlatformOverride = TargetPlatform.android; | ||
|
|
||
| await LinkRunner().enableTCFConsentCollection(true); | ||
|
|
||
| expect(calls, hasLength(1)); | ||
| expect(calls.single.method, 'enableTCFConsentCollection'); | ||
| expect(calls.single.arguments, {'enabled': true}); | ||
| }); | ||
|
|
||
| test('is a no-op on other platforms', () async { | ||
| debugDefaultTargetPlatformOverride = TargetPlatform.macOS; | ||
|
|
||
| await LinkRunner().enableTCFConsentCollection(true); | ||
|
|
||
| expect(calls, isEmpty); | ||
| }); | ||
| }); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: RathodDarshil/linkrunner
Length of output: 203
🌐 Web query:
CocoaPods LinkrunnerKit 4.1.0 enableTCFConsentCollection💡 Result:
There is no documented function or parameter named
enableTCFConsentCollectionfor LinkrunnerKit 4.1.0 or any other version of the Linkrunner SDK. Official documentation for LinkrunnerKit [1][2] and its related SDK-less integrations [3][4][5] indicates that data collection preferences—specifically regarding iOS identifiers—are handled through different mechanisms: 1. IDFA Collection: You can control IDFA collection using thedisableIdfaboolean flag during initialization [6][1]. 2. Apple Tracking Transparency: The SDK relies on standard AppleAppTrackingTransparency(ATT) protocols. To collect the IDFA, the app must include theNSUserTrackingUsageDescriptionkey in itsInfo.plistand explicitly request tracking authorization from the user usingATTrackingManager.requestTrackingAuthorization()when the app is active [3][4]. 3. Android AAID Collection: For Android, there is asetDisableAaidCollectionmethod to manage Google Advertising ID collection [7]. If you are seeing a reference toenableTCFConsentCollectionin a specific codebase, it may be a custom internal implementation, a misunderstood parameter, or related to a third-party wrapper not present in the official Linkrunner SDK documentation.Citations:
🌐 Web query:
"CocoaPods" "LinkrunnerKit" "4.1.0" "enableTCFConsentCollection"💡 Result:
There is no evidence that the method
enableTCFConsentCollectionexists in the LinkrunnerKit CocoaPods library for iOS. Documentation for LinkrunnerKit does not list this method [1][2][3]. The specific termenableTCFDataCollection(often associated with TCF v2.2 compliance) appears in the documentation for other SDKs, such as AppsFlyer [4], but it is not part of the documented public API for LinkrunnerKit [1][2]. Linkrunner handles iOS privacy primarily through App Tracking Transparency (ATT) and IDFA management [5][6][7]. If you are looking to manage consent or privacy settings in LinkrunnerKit, the standard approach involves: 1. Requesting user permission via App Tracking Transparency (ATT) usingrequestTrackingAuthorization()[5]. 2. Providing theNSUserTrackingUsageDescriptionkey in your Info.plist [5][6][8]. If you encountered a reference toenableTCFConsentCollectionin a different SDK or a specific configuration, please verify the library name, as it does not match the current LinkrunnerKit implementation [1][2].Citations:
🏁 Script executed:
Repository: RathodDarshil/linkrunner
Length of output: 15120
🌐 Web query:
site:docs.linkrunner.io/sdk ios SDK enableTCFConsentCollection LinkRunner💡 Result:
The Linkrunner iOS SDK does not feature a method named enableTCFConsentCollection [1][2]. Linkrunner's current iOS privacy and data collection strategy primarily focuses on managing IDFA collection via Apple's App Tracking Transparency (ATT) framework rather than TCF (Transparency and Consent Framework) consent signal integration [1][3][2]. To control data collection on iOS in the Linkrunner SDK: 1. IDFA Collection: You can control IDFA collection during SDK initialization using the disableIdfa boolean flag [1][4][5][6]. Setting this to true disables IDFA collection for iOS devices [1][4]. 2. ATT Framework: For legitimate IDFA collection, you must include the NSUserTrackingUsageDescription in your Info.plist and use Apple's ATT framework to request user permission [3][2]. 3. Other Privacy Controls: While Android and Flutter SDKs provide explicit methods like setDisableAaidCollection to manage Google Advertising ID (AAID) [7][8], the iOS SDK relies on standard native privacy practices and the aforementioned IDFA flag to manage device identifiers [1][2]. If your implementation specifically requires TCF support, ensure you are referencing the correct SDK documentation or verify if you are conflating Linkrunner with another analytics or attribution provider that supports IAB TCF standards.
Citations:
🌐 Web query:
"enableTCFConsentCollection" "LinkRunnerSDK.shared"💡 Result:
There is no method named enableTCFConsentCollection available in the LinkRunner SDK. Based on the official LinkRunner SDK documentation for iOS, Android, React Native, and Unity, the SDK does not provide a built-in method with that specific name [1][2][3][4][5][6]. The LinkRunner SDK focuses on attribution, analytics, and user identification, and it allows for certain data collection preferences to be managed during initialization, such as disabling IDFA on iOS or AAID on Android [1][2][3][6]. If you are looking to integrate TCF (Transparency & Consent Framework) data with mobile SDKs, this is typically handled by: 1. Using a Consent Management Platform (CMP) to obtain user consent and store the TC string in the device's local storage (e.g., UserDefaults on iOS or SharedPreferences on Android) [7][8]. 2. Some third-party SDKs have specific methods to enable TCF data collection (for example, AppsFlyer uses enableTCFDataCollection) [7], but this is not a feature of the LinkRunner SDK. If your objective is to ensure compliance when using LinkRunner, you should ensure that your app's consent flow properly records the user's choices and that you are using the SDK in accordance with your organization's privacy policy and data processing agreements [9]. If you have specific requirements for TCF support, it is recommended to contact LinkRunner support directly to verify if there are undocumented ways to pass this data or if it is currently not supported.
Citations:
🌐 Web query:
"enableTCFConsentCollection" "LinkRunnerSDK.shared" site:github.com/RathodDarshil/linkrunner_flutter💡 Result:
There is no evidence in the provided documentation that the LinkRunner SDK contains a method or property named enableTCFConsentCollection. The LinkRunner iOS SDK functions are accessed through LinkrunnerSDK.shared, but the available documentation for this interface lists methods for initialization, attribution data, user identification, event tracking, payment processing, and deep linking, with no mention of TCF (Transparency and Consent Framework) consent collection [1]. While the Android and Flutter SDKs provide methods to disable Google Advertising ID (AAID) collection [2][3] and the iOS platform allows for tracking authorization requests via ATTrackingManager [4], the provided sources do not document a specific TCF-related configuration method for LinkRunner SDKs.
Citations:
🌐 Web query:
"enableTCFConsentCollection" "LinkRunnerSDK.shared" site:github.com/RathodDarshil/linkrunner💡 Result:
I couldn’t find any GitHub result in
RathodDarshil/linkrunnerforenableTCFConsentCollectionorLinkRunnerSDK.shared. The closest Linkrunner docs I found mention TCF/consent-related setup in general, but not that exact API name. [1][2][1] (docs.linkrunner.io)
[2] (docs.linkrunner.io)
Citations:
Keep the iOS SDK dependency update in sync.
ios/linkrunner.podspecnow uses4.3.0but still pinsLinkrunnerKitto4.1.0, whileSwiftLinkrunnerPlugin.swiftcallsLinkrunnerSDK.shared.enableTCFConsentCollection(enabled). Upgrade the pinned SDK to the version that actually exports this API or remove/replace this bridge if the release note about iOS TCF consent support did not land.🤖 Prompt for AI Agents