@@ -68,12 +68,14 @@ If GDPR applies to the user, perform the following:
68681 . Given that GDPR is applicable to the user, determine whether the consent data is already stored for this session.
6969 1 . If there is no consent data stored, show the consent dialog to capture the user consent decision.
7070 2 . If there is consent data stored continue to the next step.
71- 2 . To transfer the consent data to the SDK create a JSON with the following parameters:<br >
72- ` hasConsentForDataUsage ` - Indicates whether the user has consented to use their data for advertising purposes.<br >
73- ` hasConsentForAdsPersonalization ` - Indicates whether the user has consented to use their data for personalized advertising.
74- 3 . Call ` appsFlyer.setConsentData({} ) ` with the JSON .
71+ 2 . To transfer the consent data to the SDK create an AppsFlyerConsent object using ` forGDPRUser ` method that accepts the following parameters:<br >
72+ ` hasConsentForDataUsage: boolean ` - Indicates whether the user has consented to use their data for advertising purposes.<br >
73+ ` hasConsentForAdsPersonalization: boolean ` - Indicates whether the user has consented to use their data for personalized advertising.
74+ 3 . Call ` appsFlyer.setConsentData(consentData ) ` with the AppsFlyerConsent object .
75754 . Call ` appsFlyer.initSdk() ` .
7676``` javascript
77+ import appsFlyer , {AppsFlyerConsent } from ' react-native-appsflyer' ;
78+
7779useEffect (() => {
7880 const option = {
7981 isDebug: true ,
@@ -84,10 +86,7 @@ useEffect(() => {
8486 };
8587
8688 // user consent data
87- let consentData = {
88- hasConsentForDataUsage: true / false ,
89- hasConsentForAdsPersonalization: true / false
90- }
89+ let consentData = AppsFlyerConsent .forGDPRUser (true , false );
9190
9291 appsFlyer .setConsentData (consentData);
9392
@@ -106,10 +105,12 @@ useEffect(() => {
106105### When GDPR does not apply to the user
107106
108107If GDPR doesn’t apply to the user perform the following:
109-
110- 1 . Call ` appsFlyer.setNonGDPRUser() ` .
111- 2 . Call ` appsFlyer.initSdk() ` .
108+ 1 . Create an AppsFlyerConsent object using ` forNonGDPRUser ` method that doesn't accepts any parameters
109+ 2 . Call ` appsFlyer.setConsentData(consentData) ` with the AppsFlyerConsent object .
110+ 3 . Call ` appsFlyer.initSdk() ` .
112111``` javascript
112+ import appsFlyer , {AppsFlyerConsent } from ' react-native-appsflyer' ;
113+
113114useEffect (() => {
114115 const option = {
115116 isDebug: true ,
@@ -120,7 +121,9 @@ useEffect(() => {
120121 };
121122
122123 // GDPR does not apply to the user
123- appsFlyer .setNonGDPRUser ()
124+ let consentData = AppsFlyerConsent .forNonGDPRUser ();
125+
126+ appsFlyer .setConsentData (consentData);
124127
125128 // start appsflyer
126129 appsFlyer .initSdk (
0 commit comments