You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+93Lines changed: 93 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ Built with AppsFlyer Android SDK `v6.13.0`
32
32
-[Register In-App Events](#adding_events)
33
33
-[Get Conversion Data](#conversion_data)
34
34
-[Unified Deep Linking](#deep_linking)
35
+
-[Send consent for DMA compliance](#dma_support)
35
36
-[Sample App](#sample_app)
36
37
37
38
@@ -70,6 +71,7 @@ AppsFlyer supports the `identify` and `track` methods.
70
71
### <aid="manual">
71
72
# Manual mode
72
73
Starting version 6.8.0, we support a manual mode to seperate the initialization of the AppsFlyer SDK and the start of the SDK. In this case, the AppsFlyer SDK won't start automatically, giving the developper more freedom when to start the AppsFlyer SDK. Please note that in manual mode, the developper is required to implement the API startAppsFlyer(Context context) in order to start the SDK.
74
+
<br>If you are using CMP to collect consent data this feature is needed. See explanation [here](#dma_support).
73
75
### Example:
74
76
75
77
```java
@@ -252,6 +254,97 @@ In order to implement unified deep linking, call the method below :
252
254
```
253
255
For more information about unified deep linking, check [here](https://dev.appsflyer.com/docs/android-unified-deep-linking)
254
256
257
+
## <aid="dma_support"> Send consent for DMA compliance
258
+
For a general introduction to DMA consent data, see [here](https://dev.appsflyer.com/hc/docs/send-consent-for-dma-compliance).<be>
259
+
The SDK offers two alternative methods for gathering consent data:<br>
260
+
-**Through a Consent Management Platform (CMP)**: If the app uses a CMP that complies with the [Transparency and Consent Framework (TCF) v2.2 protocol](https://iabeurope.eu/tcf-supporting-resources/), the SDK can automatically retrieve the consent details.<br>
261
+
<br>OR<br><br>
262
+
-**Through a dedicated SDK API**: Developers can pass Google's required consent data directly to the SDK using a specific API designed for this purpose.
263
+
### Use CMP to collect consent data
264
+
A CMP compatible with TCF v2.2 collects DMA consent data and stores it in <code>SharedPreferences</code>. To enable the SDK to access this data and include it with every event, follow these steps:<br>
265
+
<ol>
266
+
<li> Call <code>AppsFlyerLib.getInstance().enableTCFDataCollection(true)</code> to instruct the SDK to collect the TCF data from the device.
267
+
<li> Set the the adapter to be manual : <code>AppsflyerIntegration.setManualMode(true)</code>. <br> This will allow us to delay the Conversion call in order to provide the SDK with the user consent.
268
+
<li> Initialize Segment using <code>AppsflyerIntegration.FACTORY</code>.
269
+
<li> In the <code>Activity</code> class, use the CMP to decide if you need the consent dialog in the current session.
270
+
<li> If needed, show the consent dialog, using the CMP, to capture the user consent decision. Otherwise, go to step 6.
271
+
<li> Get confirmation from the CMP that the user has made their consent decision, and the data is available in <code>SharedPreferences</code>.
// When the flow is completed and consent was collected
312
+
// call onConsentCollectionFinished()
313
+
}
314
+
315
+
private void onConsentCollectionFinished() {
316
+
AppsflyerIntegration.startAppsFlyer(this);
317
+
}
318
+
}
319
+
```
320
+
321
+
322
+
### Manually collect consent data
323
+
If your app does not use a CMP compatible with TCF v2.2, use the SDK API detailed below to provide the consent data directly to the SDK.
324
+
<ol>
325
+
<li> Initialize <code>AppsFlyerIntegration</code> using manual mode and also <code>Analytics</code>. This will allow us to delay the Conversion call in order to provide the SDK with the user consent.
326
+
<li> In the <code>Activity</code> class, determine whether the GDPR applies or not to the user.<br>
327
+
- If GDPR applies to the user, perform the following:
328
+
<ol>
329
+
<li> Given that GDPR is applicable to the user, determine whether the consent data is already stored for this session.
330
+
<ol>
331
+
<li> If there is no consent data stored, show the consent dialog to capture the user consent decision.
332
+
<li> If there is consent data stored continue to the next step.
333
+
</ol>
334
+
<li> To transfer the consent data to the SDK create an object called <code>AppsFlyerConsent</code> using the <code>forGDPRUser()</code> method with the following parameters:<br>
335
+
- <code>hasConsentForDataUsage</code> - Indicates whether the user has consented to use their data for advertising purposes.<br>
336
+
- <code>hasConsentForAdsPersonalization</code> - Indicates whether the user has consented to use their data for personalized advertising purposes.
337
+
<li> Call <code>AppsFlyerLib.getInstance().setConsentData()</code> with the <code>AppsFlyerConsent</code> object.
0 commit comments