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
Your events will now begin to flow to AppsFlyer in device mode.
55
56
57
+
## Appsflyer SDK documentation
58
+
Please go here to see the Appsflyer Native iOS documentation [here](https://dev.appsflyer.com/hc/docs/ios-sdk)
59
+
60
+
## <aid="manual"> Manual mode
61
+
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 developer more freedom when to start the AppsFlyer SDK. Please note that in manual mode, the developper is required to implement the API ``startAppsflyerSDK()`` in order to start the SDK.
62
+
<br>If you are using CMP to collect consent data this feature is needed. See explanation [here](#dma_support).
In order for Conversion Data to be sent to Segment, make sure you have enabled "Track Attribution Data" and specified App ID in AppsFlyer destination settings:
## <a id="dma_support"> Send consent for DMA compliance
184
+
**important:** As of Appsflyer SDK 6.17.0 there are additions in the Appsflyer SDK API on how to use DMA, [see here](https://dev.appsflyer.com/hc/docs/ios-send-consent-for-dma-compliance).<br>
185
+
The SDK offers two alternative methods for gathering consent data:<br>
186
+
-**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>
187
+
<br>OR<br><br>
188
+
-**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.
189
+
### Use CMP to collect consent data
190
+
A CMP compatible with TCF v2.2 collects DMA consent data and stores it in<code>NSUserDefaults</code>. To enable the SDK to access this data and include it with every event, follow these steps:<br>
191
+
<ol>
192
+
<li> Call <code>AppsFlyerLib.shared().enableTCFDataCollection(true)</code> to instruct the SDK to collect the TCF data from the device.
193
+
<li> Initialize <code>AppsFlyerDestination</code> using manualMode =true. This will allow us to delay the Conversion call in order to provide the SDK with the user consent.
194
+
<li> In the <code>applicationDidBecomeActive</code> lifecycle method, use the CMP to decide if you need the consent dialog in the current session to acquire the consent data. If you need the consent dialog move to step 4; otherwise move to step 5.
195
+
<li> Get confirmation from the CMP that the user has made their consent decision and the data is available in<code>NSUserDefaults</code>.
ATTrackingManager.requestTrackingAuthorization { (status) in
233
+
switch status {
234
+
case .denied:
235
+
print("AuthorizationSatus is denied")
236
+
case .notDetermined:
237
+
print("AuthorizationSatus is notDetermined")
238
+
case .restricted:
239
+
print("AuthorizationSatus is restricted")
240
+
case .authorized:
241
+
print("AuthorizationSatus is authorized")
242
+
@unknowndefault:
243
+
fatalError("Invalid authorization status")
244
+
}
245
+
}
246
+
}
247
+
}
248
+
```
249
+
250
+
### Manually collect consent data
251
+
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.
252
+
<ol>
253
+
<li> Initialize <code>AppsFlyerDestination</code> using manual mode. This will allow us to delay the Conversion call in order to provide the SDK with the user consent.
254
+
<li> In the <code>applicationDidBecomeActive</code> lifecycle method determine whether the GDPR applies or not to the user.<br>
255
+
- If GDPR applies to the user, perform the following:
256
+
<ol>
257
+
<li> Given that GDPR is applicable to the user, determine whether the consent data is already stored for this session.
258
+
<ol>
259
+
<li> If there is no consent data stored, show the consent dialog to capture the user consent decision.
260
+
<li> If there is consent data stored continue to the next step.
261
+
</ol>
262
+
<li> To transfer the consent data to the SDK create an AppsFlyerConsent object with the following parameters:<br>
263
+
-<code>forGDPRUserWithHasConsentForDataUsage</code>- Indicates whether the user has consented to use their data for advertising purposes.
264
+
-<code>hasConsentForAdsPersonalization</code>- Indicates whether the user has consented to use their data for personalized advertising.
<li> It isoptional to initialize <code>AppsFlyerDestination</code> using manual mode not mandatory as before.
272
+
</ol>
273
+
</ol>
274
+
275
+
276
+
## <a id="usage"> Usage
277
+
278
+
First of all, you must provide values for AppsFlyer Dev Key, Apple App ID (iTunes) and client secret in Segment's **dashboard**for AppsFlyer integration
0 commit comments