@@ -10,42 +10,62 @@ namespace AppsFlyerSDK
1010 // This class should be used to notify and record the user's applicability
1111 // under GDPR, their general consent to data usage, and their consent to personalized
1212 // advertisements based on user data.
13-
14- // Note that the consent for data usage and ads personalization pair is only applicable when the user is
15- // subject to GDPR guidelines. Therefore, the following factory methods should be used accordingly:
16- // - Use [forGDPRUser] when the user is subject to GDPR.
17- // - Use [forNonGDPRUser] when the user is not subject to GDPR.
1813
19- // @property isUserSubjectToGDPR Indicates whether GDPR regulations apply to the user (true if the user is
20- // a subject of GDPR). It also serves as a flag for compliance with relevant aspects of DMA regulations.
21- // @property hasConsentForDataUsage Indicates whether the user has consented to the use of their data for advertising
22- // purposes under both GDPR and DMA guidelines (true if the user has consented, nullable if not subject to GDPR).
23- // @property hasConsentForAdsPersonalization Indicates whether the user has consented to the use of their data for
24- // personalized advertising within the boundaries of GDPR and DMA rules (true if the user has consented to
25- // personalized ads, nullable if not subject to GDPR).
14+ /// ## Properties:
15+ /// - `isUserSubjectToGDPR` (optional) - Indicates whether GDPR regulations apply to the user.
16+ /// This may also serve as a general compliance flag for other regional regulations.
17+ /// - `hasConsentForDataUsage` (optional) - Indicates whether the user consents to the processing
18+ /// of their data for advertising purposes.
19+ /// - `hasConsentForAdsPersonalization` (optional) - Indicates whether the user consents to the
20+ /// use of their data for personalized advertising.
21+ /// - `hasConsentForAdStorage` (optional) - Indicates whether the user consents to ad-related storage access.
22+ ///
23+ /// **Usage Example:**
24+ /// ```csharp
25+ /// var consent = new AppsFlyerConsent(
26+ /// isUserSubjectToGDPR: true,
27+ /// hasConsentForDataUsage: true,
28+ /// hasConsentForAdsPersonalization: false,
29+ /// hasConsentForAdStorage: true
30+ /// );
31+ /// **Deprecated APIs:**
32+ /// - `ForGDPRUser(...)` and `ForNonGDPRUser(...)` should no longer be used.
33+ /// - Use `new AppsFlyerConsent(...)` instead with relevant consent fields.
34+ ///
2635 /// </summary>
2736 public class AppsFlyerConsent
2837 {
29- public bool isUserSubjectToGDPR { get ; private set ; }
30- public bool hasConsentForDataUsage { get ; private set ; }
31- public bool hasConsentForAdsPersonalization { get ; private set ; }
38+ public bool ? isUserSubjectToGDPR { get ; private set ; }
39+ public bool ? hasConsentForDataUsage { get ; private set ; }
40+ public bool ? hasConsentForAdsPersonalization { get ; private set ; }
41+ public bool ? hasConsentForAdStorage { get ; private set ; }
3242
43+ public AppsFlyerConsent ( bool ? isUserSubjectToGDPR = null , bool ? hasConsentForDataUsage = null , bool ? hasConsentForAdsPersonalization = null , bool ? hasConsentForAdStorage = null )
44+ {
45+ this . isUserSubjectToGDPR = isUserSubjectToGDPR ;
46+ this . hasConsentForDataUsage = hasConsentForDataUsage ;
47+ this . hasConsentForAdsPersonalization = hasConsentForAdsPersonalization ;
48+ this . hasConsentForAdStorage = hasConsentForAdStorage ;
49+ }
50+
51+ [ Obsolete ( "Use the new constructor with optional booleans instead." ) ]
3352 private AppsFlyerConsent ( bool isGDPR , bool hasForDataUsage , bool hasForAdsPersonalization )
3453 {
3554 isUserSubjectToGDPR = isGDPR ;
3655 hasConsentForDataUsage = hasForDataUsage ;
3756 hasConsentForAdsPersonalization = hasForAdsPersonalization ;
3857 }
3958
59+ [ Obsolete ( "Use new AppsFlyerConsent(...) instead." ) ]
4060 public static AppsFlyerConsent ForGDPRUser ( bool hasConsentForDataUsage , bool hasConsentForAdsPersonalization )
4161 {
4262 return new AppsFlyerConsent ( true , hasConsentForDataUsage , hasConsentForAdsPersonalization ) ;
4363 }
4464
65+ [ Obsolete ( "Use new AppsFlyerConsent(...) instead." ) ]
4566 public static AppsFlyerConsent ForNonGDPRUser ( )
4667 {
4768 return new AppsFlyerConsent ( false , false , false ) ;
4869 }
4970 }
50-
5171}
0 commit comments