Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
0.3.0 (April 7, 2022)
- Added user consent feature to allow delaying or disabling the data tracking from SDK until user consent is explicitly granted or declined. Read more in our docs.

0.2.0 (March 31, 2022)
- Added support for user consent, a way to control if the SDK tracks impressions and events or not, based on users granting or rejecting consent for it.
- Added support to SDK clients to optionally bind attributes, keeping these loaded within the SDK along with the user ID, for easier usage when requesting flag.
- Added `scheduler.impressionsQueueSize` property to SDK configuration (See https://help.split.io/hc/en-us/articles/4406066357901-React-Native-SDK#configuration).
- Updated some NPM dependencies for vulnerability fixes.
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ PODS:
- React-cxxreact (= 0.64.1)
- React-jsi (= 0.64.1)
- React-perflogger (= 0.64.1)
- RNSplit (0.2.0):
- RNSplit (0.3.0):
- React
- Yoga (1.14.0)
- YogaKit (1.18.1):
Expand Down Expand Up @@ -488,7 +488,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 4b99a7f5c6c0abbc5256410cc5425fb8531986e1
React-runtimeexecutor: ff951a0c241bfaefc4940a3f1f1a229e7cb32fa6
ReactCommon: bedc99ed4dae329c4fcf128d0c31b9115e5365ca
RNSplit: c04b293ec271725d77729f8d4703a189bbf5b8a3
RNSplit: f4a2929c402a525a1a9ab2fa26b9843ec1409957
Yoga: a7de31c64fe738607e7a3803e3f591a4b1df7393
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio-react-native",
"version": "0.2.0",
"version": "0.3.0",
"description": "Split SDK for React Native",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
Expand Down Expand Up @@ -54,7 +54,7 @@
},
"homepage": "https://github.com/splitio/react-native-client#readme",
"dependencies": {
"@splitsoftware/splitio-commons": "1.2.1-rc.11"
"@splitsoftware/splitio-commons": "1.3.0"
},
"devDependencies": {
"@react-native-community/eslint-config": "^2.0.0",
Expand Down
8 changes: 6 additions & 2 deletions src/platform/getModules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { shouldAddPt } from '@splitsoftware/splitio-commons/src/trackers/impress
import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
import { ISettings } from '@splitsoftware/splitio-commons/src/types';
import { LOCALHOST_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
import { userConsentProps } from '@splitsoftware/splitio-commons/src/sdkFactory/userConsentProps';
import { createUserConsentAPI } from '@splitsoftware/splitio-commons/src/consent/sdkUserConsent';

import { RNSignalListener } from './RNSignalListener';
import { getEventSource } from './getEventSource';
Expand Down Expand Up @@ -47,7 +47,11 @@ export function getModules(settings: ISettings): ISdkFactoryParams {

impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined,

extraProps: userConsentProps,
extraProps: (params) => {
return {
UserConsent: createUserConsentAPI(params),
};
},
};

if (settings.mode === LOCALHOST_MODE) {
Expand Down
2 changes: 1 addition & 1 deletion src/settings/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConsentStatus } from '@splitsoftware/splitio-commons/src/types';
import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants';

const packageVersion = '0.2.0';
const packageVersion = '0.3.0';

export const defaults = {
startup: {
Expand Down
53 changes: 35 additions & 18 deletions types/splitio.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,38 @@ interface ILoggerAPI {
* Log level constants. Use this to pass them to setLogLevel function.
*/
LogLevel: {
[level: string]: LogLevel
[level in LogLevel]: LogLevel
}
}
/**
* User consent API
* @interface IUserConsentAPI
*/
interface IUserConsentAPI {
/**
* Set or update the user consent status. Possible values are `true` and `false`, which represent user consent `'GRANTED'` and `'DECLINED'` respectively.
* - `true ('GRANTED')`: the user has granted consent for tracking events and impressions. The SDK will send them to Split cloud.
* - `false ('DECLINED')`: the user has declined consent for tracking events and impressions. The SDK will not send them to Split cloud.
*
* NOTE: calling this method updates the user consent at a factory level, affecting all clients of the same factory.
*
* @function setStatus
* @param {boolean} userConsent The user consent status, true for 'GRANTED' and false for 'DECLINED'.
* @returns {boolean} Whether the provided param is a valid value (i.e., a boolean value) or not.
*/
setStatus(userConsent: boolean): boolean;
/**
* Get the user consent status.
*
* @function getStatus
* @returns {ConsentStatus} The user consent status.
*/
getStatus(): SplitIO.ConsentStatus;
/**
* Consent status constants. Use this to compare with the getStatus function result.
*/
Status: {
[status in SplitIO.ConsentStatus]: SplitIO.ConsentStatus
}
}
/**
Expand Down Expand Up @@ -784,24 +815,10 @@ declare namespace SplitIO {
*/
manager(): IManager,
/**
* Set or update the user consent status. Possible values are `true` and `false`, which represent user consent `'GRANTED'` and `'DECLINED'` respectively.
* - `true ('GRANTED')`: the user has granted consent for tracking events and impressions. The SDK will send them to Split cloud.
* - `false ('DECLINED')`: the user has declined consent for tracking events and impressions. The SDK will not send them to Split cloud.
*
* NOTE: calling this method updates the user consent at a factory level, affecting all clients of the same factory.
*
* @function setUserConsent
* @param {boolean} userConsent The user consent status, true for 'GRANTED' and false for 'DECLINED'.
* @returns {boolean} Whether the provided param is a valid value (i.e., a boolean value) or not.
*/
setUserConsent(userConsent: boolean): boolean;
/**
* Get the user consent status.
*
* @function getUserConsent
* @returns {ConsentStatus} The user consent status.
* User consent API.
* @property UserConsent
*/
getUserConsent(): SplitIO.ConsentStatus;
UserConsent: IUserConsentAPI
}

/**
Expand Down