Skip to content

Commit a99397d

Browse files
authored
Merge pull request #621 from AppsFlyerSDK/dev/DELIVERY-89774/custom-params-delegate
Dev/delivery 89774/custom params delegate
2 parents 7f9e4c5 + b6f65b8 commit a99397d

28 files changed

Lines changed: 864 additions & 291 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 6.15.3
2+
Release date: *2025-01-8*
3+
4+
- React Native >> Update iOS SDK to v6.15.3
5+
- React native >> Update Android SDK to v6.15.2
6+
17
## 6.15.1
28
Release date: *2024-09-15*
39

Docs/RN_API.md

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,53 @@ hidden: false
99
## APIs
1010

1111
The list of available methods for this plugin is described below.
12+
- [APIs](#apis)
1213
- [Android and iOS APIs](#android-and-ios-apis)
13-
- [initSDK](#initsdk)
14-
- [startSdk](#startsdk)
15-
- [logEvent](#logevent)
16-
- [setCustomerUserId](#setcustomeruserid)
17-
- [stop](#stop)
18-
- [setAppInviteOneLinkID](#setappinviteonelinkid)
19-
- [setAdditionalData](#setadditionaldata)
20-
- [setResolveDeepLinkURLs](#setresolvedeeplinkurls)
21-
- [setOneLinkCustomDomain](#setonelinkcustomdomain)
22-
- [setCurrencyCode](#setcurrencycode)
23-
- [logLocation](#loglocation)
24-
- [anonymizeUser](#anonymizeuser)
25-
- [getAppsFlyerUID](#getappsflyeruid)
26-
- [setHost](#sethost)
27-
- [setUserEmails](#setuseremails)
28-
- [generateInviteLink](#generateinvitelink)
29-
- [setSharingFilterForAllPartners](#setsharingfilterforallpartners) *Deprecated*
30-
- [setSharingFilter](#setsharingfilter) *Deprecated*
31-
- [setSharingFilterForPartners](#setsharingfilterforpartners)
32-
- [validateAndLogInAppPurchase](#validateandloginapppurchase)
33-
- [updateServerUninstallToken](#updateserveruninstalltoken)
34-
- [sendPushNotificationData](#sendpushnotificationdata)
35-
- [addPushNotificationDeepLinkPath](#addpushnotificationdeeplinkpath)
36-
- [appendParametersToDeepLinkingURL](#appendparameterstodeeplinkingurl)
37-
- [disableAdvertisingIdentifier](#disableAdvertisingIdentifier)
38-
- [enableTCFDataCollection](#enableTCFDataCollection)
39-
- [setConsentData](#setConsentData)
40-
- [logAdRevenue](#logAdRevenue)
14+
- [initSdk](#initsdk)
15+
- [startSdk](#startsdk)
16+
- [logEvent](#logevent)
17+
- [setCustomerUserId](#setcustomeruserid)
18+
- [stop](#stop)
19+
- [setAppInviteOneLinkID](#setappinviteonelinkid)
20+
- [setAdditionalData](#setadditionaldata)
21+
- [setResolveDeepLinkURLs](#setresolvedeeplinkurls)
22+
- [setOneLinkCustomDomains](#setonelinkcustomdomains)
23+
- [setCurrencyCode](#setcurrencycode)
24+
- [logLocation](#loglocation)
25+
- [anonymizeUser](#anonymizeuser)
26+
- [getAppsFlyerUID](#getappsflyeruid)
27+
- [setHost](#sethost)
28+
- [setUserEmails](#setuseremails)
29+
- [generateInviteLink](#generateinvitelink)
30+
- [setSharingFilterForAllPartners](#setsharingfilterforallpartners)
31+
- [setSharingFilter](#setsharingfilter)
32+
- [setSharingFilterForPartners](#setsharingfilterforpartners)
33+
- [validateAndLogInAppPurchase](#validateandloginapppurchase)
34+
- [updateServerUninstallToken](#updateserveruninstalltoken)
35+
- [sendPushNotificationData](#sendpushnotificationdata)
36+
- [addPushNotificationDeepLinkPath](#addpushnotificationdeeplinkpath)
37+
- [appendParametersToDeepLinkingURL](#appendparameterstodeeplinkingurl)
38+
- [disableAdvertisingIdentifier](#disableadvertisingidentifier)
39+
- [enableTCFDataCollection](#enabletcfdatacollection)
40+
- [setConsentData](#setconsentdata)
41+
- [logAdRevenue](#logadrevenue)
4142
- [Android Only APIs](#android-only-apis)
42-
- [setCollectAndroidID](#setcollectandroidid)
43-
- [setCollectIMEI](#setcollectimei)
44-
- [setDisableNetworkData](#setdisablenetworkdata)
45-
- [performOnDeepLinking](#performondeeplinking)
43+
- [setCollectAndroidID](#setcollectandroidid)
44+
- [setCollectIMEI](#setcollectimei)
45+
- [setDisableNetworkData `setDisableNetworkData(disable)`](#setdisablenetworkdata-setdisablenetworkdatadisable)
46+
- [performOnDeepLinking](#performondeeplinking)
4647
- [iOS Only APIs](#ios-only-apis)
47-
- [disableCollectASA](#disablecollectasa)
48-
- [setUseReceiptValidationSandbox](#setusereceiptvalidationsandbox)
49-
- [disableSKAD](#disableskad)
50-
- [setCurrentDeviceLanguage](#setcurrentdevicelanguage)
51-
- [disableIDFVCollection](#disableidfvcollection)
48+
- [disableCollectASA](#disablecollectasa)
49+
- [disableIDFVCollection](#disableidfvcollection)
50+
- [setUseReceiptValidationSandbox](#setusereceiptvalidationsandbox)
51+
- [disableSKAD](#disableskad)
52+
- [setCurrentDeviceLanguage](#setcurrentdevicelanguage)
5253
- [AppsFlyerConversionData](#appsflyerconversiondata)
53-
- [onInstallConversionData](#oninstallconversiondata)
54-
- [onInstallConversionFailure](#oninstallconversionfailure)
55-
- [onAppOpenAttribution](#onappopenattribution)
56-
- [onAttributionFailure](#onattributionfailure)
57-
- [onDeepLink](#ondeeplink)
54+
- [onInstallConversionData](#oninstallconversiondata)
55+
- [onInstallConversionFailure](#oninstallconversionfailure)
56+
- [onAppOpenAttribution](#onappopenattribution)
57+
- [onAttributionFailure](#onattributionfailure)
58+
- [onDeepLink](#ondeeplink)
5859
---
5960

6061
## Android and iOS APIs
@@ -109,7 +110,7 @@ appsFlyer.initSdk(
109110
```
110111
---
111112

112-
#### startSdk
113+
### startSdk
113114
`startSdk()`
114115

115116
In version 6.9.1 of the react-native-appslfyer SDK we added the option of splitting between the initialization stage and start stage. All you need to do is add the property manualStart: true to the init object, and later call appsFlyer.startSdk() whenever you decide. If this property is set to false or doesn’t exist, the sdk will start after calling `appsFlyer.initSdk(...)`.
@@ -147,7 +148,7 @@ appsFlyer.initSdk(
147148
```
148149
---
149150

150-
#### logEvent
151+
### logEvent
151152
`logEvent(eventName, eventValues, success, error)`
152153

153154
In-App Events provide insight on what is happening in your app. It is recommended to take the time and define the events you want to measure to allow you to measure ROI (Return on Investment) and LTV (Lifetime Value).
@@ -798,20 +799,18 @@ let GDPRUser = AppsFlyerConsent.forGDPRUser(true, false);
798799
appsFlyer.setConsentData(nonGDPRUser /**or**/ GDPRUser);
799800
```
800801

801-
### logAdRevenue - Since 6.15.1
802+
### logAdRevenue
802803
`logAdRevenue(data: AFAdRevenueData): void`
803804

804805
Use this method to log your ad revenue.</br>
805806
By attributing ad revenue, app owners gain the complete view of user LTV and campaign ROI.
806807
Ad revenue is generated by displaying ads on rewarded videos, offer walls, interstitials, and banners in an app.
807808

808-
#### Parameters
809-
810809
| Param | Type |
811810
| -------------- | ---------------------------------------------------------- |
812811
| **`data`** | `AFAdRevenueData` |
813812

814-
#### Usage Example for React Native:
813+
*Example:*
815814

816815
```javascript
817816
const adRevenueData = {

Docs/RN_CMP.md

Lines changed: 96 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -59,81 +59,123 @@ A CMP compatible with TCF v2.2 collects DMA consent data and stores it in NSUser
5959
}
6060
},[])
6161
```
62-
## Manually collect consent data
63-
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.
64-
65-
### When GDPR applies to the user
66-
If GDPR applies to the user, perform the following:
67-
68-
1. Given that GDPR is applicable to the user, determine whether the consent data is already stored for this session.
69-
1. If there is no consent data stored, show the consent dialog to capture the user consent decision.
70-
2. If there is consent data stored continue to the next step.
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.
75-
4. Call `appsFlyer.initSdk()`.
62+
63+
### Manually Collecting Consent Data
64+
65+
If your app does not use a TCF v2.2-compatible CMP, you must manually provide the consent data using the SDK API.
66+
67+
How to Set Consent Data: </br>
68+
1. Determine GDPR Applicability:
69+
* If GDPR applies, check whether consent data is already stored.
70+
* If not stored, show a consent dialog to obtain user consent.
71+
2. Create an AppsFlyerConsent object with the relevant parameters.
72+
3. Pass the consent data to the SDK using appsFlyer.setConsentData(consentData).
73+
4. Initialize the SDK with appsFlyer.initSdk().
74+
75+
#### Setting Consent Data for Users
76+
77+
<b>When GDPR Applies</b>
78+
79+
If GDPR applies to the user, create an AppsFlyerConsent object with the user’s preferences.
7680
```javascript
77-
import appsFlyer, {AppsFlyerConsent} from 'react-native-appsflyer';
81+
import appsFlyer, { AppsFlyerConsent } from 'react-native-appsflyer';
7882

7983
useEffect(() => {
8084
const option = {
81-
isDebug: true,
82-
devKey: 'UxXxXxXxXd',
83-
onInstallConversionDataListener: true,
84-
onDeepLinkListener: true,
85-
timeToWaitForATTUserAuthorization: 10,
85+
isDebug: true,
86+
devKey: 'UxXxXxXxXd',
87+
onInstallConversionDataListener: true,
88+
onDeepLinkListener: true,
89+
timeToWaitForATTUserAuthorization: 10,
8690
};
8791

88-
// user consent data
89-
let consentData = AppsFlyerConsent.forGDPRUser(true, false);
92+
// User has given consent
93+
const consentData = new AppsFlyerConsent(true, true, true, true);
9094

95+
// Send consent data to the SDK
9196
appsFlyer.setConsentData(consentData);
9297

93-
//start appsflyer
98+
// Start AppsFlyer SDK
9499
appsFlyer.initSdk(
95-
option,
96-
res => {
97-
console.log(res);
98-
},
99-
err => {
100-
console.log(err);
101-
},
100+
option,
101+
res => console.log(res),
102+
err => console.log(err)
102103
);
103-
},[])
104+
}, []);
104105
```
105-
### When GDPR does not apply to the user
106106

107-
If GDPR doesn’t apply to the user perform the following:
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()`.
107+
<b>When GDPR Does Not Apply</b>
108+
109+
If GDPR does not apply to the user, simply mark it as such in the AppsFlyerConsent object.
111110
```javascript
112-
import appsFlyer, {AppsFlyerConsent} from 'react-native-appsflyer';
111+
import appsFlyer, { AppsFlyerConsent } from 'react-native-appsflyer';
113112

114113
useEffect(() => {
115114
const option = {
116-
isDebug: true,
117-
devKey: 'UxXxXxXxXd',
118-
onInstallConversionDataListener: true,
119-
onDeepLinkListener: true,
120-
timeToWaitForATTUserAuthorization: 10,
115+
isDebug: true,
116+
devKey: 'UxXxXxXxXd',
117+
onInstallConversionDataListener: true,
118+
onDeepLinkListener: true,
119+
timeToWaitForATTUserAuthorization: 10,
121120
};
122121

123122
// GDPR does not apply to the user
124-
let consentData = AppsFlyerConsent.forNonGDPRUser();
123+
const consentData = new AppsFlyerConsent(false);
125124

126-
appsFlyer.setConsentData(consentData);
125+
// Send consent data to the SDK
126+
appsFlyer.setConsentData(consentData);
127127

128-
//start appsflyer
128+
// Start AppsFlyer SDK
129129
appsFlyer.initSdk(
130-
option,
131-
res => {
132-
console.log(res);
133-
},
134-
err => {
135-
console.log(err);
136-
},
130+
option,
131+
res => console.log(res),
132+
err => console.log(err)
137133
);
138-
},[])
139-
```
134+
}, []);
135+
```
136+
137+
### Consent Object API
138+
139+
```javascript
140+
//AppsFlyerConsent Constructor:
141+
142+
new AppsFlyerConsent(
143+
isUserSubjectToGDPR, // Boolean (optional) - Whether GDPR applies to the user
144+
hasConsentForDataUsage, // Boolean (optional) - Consent for data usage
145+
hasConsentForAdsPersonalization, // Boolean (optional) - Consent for ads personalization
146+
hasConsentForAdStorage // Boolean (optional) - Consent for ad storage
147+
);
148+
149+
//Example Cases:
150+
151+
// Full consent for GDPR user
152+
const consent1 = new AppsFlyerConsent(true, true, true, true);
153+
154+
// No consent for GDPR user
155+
const consent2 = new AppsFlyerConsent(true, false, false, false);
156+
157+
// Non-GDPR user
158+
const consent3 = new AppsFlyerConsent(false);
159+
160+
// AppsFlyerConsent object support the following cases if they are needed.
161+
const consent4 = new AppsFlyerConsent(true);
162+
const consent5 = new AppsFlyerConsent(true, true);
163+
const consent6 = new AppsFlyerConsent(null, true, true, true);
164+
const consent7 = new AppsFlyerConsent(true, null, true, true);
165+
const consent8 = new AppsFlyerConsent(true, true, null, true);
166+
const consent9 = new AppsFlyerConsent(true, true, true, null);
167+
const consent10 = new AppsFlyerConsent(true, true, false, true);
168+
const consent11 = new AppsFlyerConsent(false, true, false, false);
169+
const consent12 = new AppsFlyerConsent(null, null, null, null);
170+
const consent13 = new AppsFlyerConsent();
171+
```
172+
173+
### Deprecation Notice
174+
175+
The following methods have been deprecated since SDK version 6.16.2 and should no longer be used:
176+
```javascript
177+
// Deprecated since 6.16.2
178+
AppsFlyerConsent.forGDPRUser(true, false);
179+
AppsFlyerConsent.forNonGDPRUser();
180+
```
181+
Instead, use the new AppsFlyerConsent constructor.

0 commit comments

Comments
 (0)