
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
@economist/react-native-consent
Advanced tools
Consent management for mobile
npm install @economist/react-native-consent
or
yarn add @economist/react-native-consent
Use it like a view, this gives you more flexibility, because you can integrate that view in any screen.
import { ConsentView } from '@economist/react-native-consent';
// ...
const onUserConsentReceived = React.useCallback((_userData: SPUserData, error: string | null) => {
// ...
}, []);
<ConsentView
onConsentReceived={onUserConsentReceived}
config={{
propertyName: 'mobile.multicampaign.demo',
accountId: 22,
privacyManagerId: "14967",
}}
style={{ width: '100%', height: '100%' }}
renderLoading=(() => <MyCustomLoadingIndicator>) // completely custom loading indicator
loadingAccentColor={"blue"} // the color for the default loading indicator
/>;
Use the already defined native iOS / Android screens. This will a show transparent modal on iOS and a transparent not fullscreen activity on Android.
import {
consentManagement,
ConsentConfig,
SPUserData,
} from '@economist/react-native-consent';
const onUserConsentReceived = React.useCallback((_userData: SPUserData, error: string | null) => {
Alert.alert('Consent received');
}, []);
const onShowConsentPress = React.useCallback(() => {
consentManagement.showConsentPopup({
propertyName: 'mobile.multicampaign.demo',
accountId: 22,
privacyManagerId: "14967",
});
}, []);
React.useEffect(() => {
consentManagement.listenForConsentResponse(onUserConsentReceived);
}, []);
return (
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'white',
}}
>
<TouchableOpacity onPress={onShowConsentPress}>
<Text>Show native consent popup</Text>
</TouchableOpacity>
</View>
);
For Android you also need to declare a new activity in your AndroidManifest.xml
file.
<activity
android:name="com.consent.views.consentactivity.ConsentActivity"
android:theme="@style/RNConsent.Theme.Transparent"
android:exported="false" />
Get the current consent data saved in the local storage. Useful if you want to check if the consent was given or not.
let result: Promise<SPUserData> = await consentManagement.getUserConsentFromLocalStorage(config)
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
Consent management for Economist's React Native apps
The npm package @economist/react-native-consent receives a total of 12 weekly downloads. As such, @economist/react-native-consent popularity was classified as not popular.
We found that @economist/react-native-consent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 179 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.