Socket
Book a DemoInstallSign in
Socket

react-native-app-consent

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-app-consent

react-native-app-consent

latest
npmnpm
Version
0.2.5
Version published
Maintainers
1
Created
Source

Getting started

$ yarn add git+https://gitlab+deploy-token-98:N3jnpXWzcBmuaaxHkRhs@git.snapp.fr/fidme/apps/modules/react-native-app-consent

Manual installation

iOS

  • In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  • Go to node_modulesreact-native-app-consent and add RNAppConsent.xcodeproj
  • In XCode, in the project navigator, select your project. Add libRNAppConsent.a to your project's Build PhasesLink Binary With Libraries
  • Run your project (Cmd+R)
Additional iOS step

You need to manually follow these steps :

  • Open up your project in Xcode
  • Select the main target (under "Targets"),
  • Go to the "Build Settings" tab, and find the "Framework Search Paths" section.
  • Add $(SRCROOT)/../node_modules/react-native-app-consent/ios (non-recursive) for each of your configurations (e.g. Debug and Release).
  • Find the AppConsentKit.framework file in ../node_modules/react-native-app-consent/ios and drag it into Xcode under the "Frameworks" group. In the dialog that pops up, uncheck "Copy items if needed", choose "Create groups", and ensure your main target is checked under "Add to targets".
  • In Xcode, select the project, then select the main target (under "Targets"), then go to the "General" tab and find the "Embedded Binaries" section. Click the "+" icon and select AppConsentKit.framework which appears under "Frameworks" then click "Add".
  • Clean your project "Product" -> "Clean"
  • Run your project (Cmd+R)

Android

  • Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.fidme.appconsent.RNAppConsentPackage; to the imports at the top of the file
  • Add new RNAppConsentPackage() to the list returned by the getPackages() method
  • Append the following lines to android/settings.gradle:
include ':react-native-app-consent'
project(':react-native-app-consent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-app-consent/android')
  • Insert the following lines inside the dependencies block in android/app/build.gradle:
implementation project(':react-native-app-consent')
Additional Android step
  • Open up your project in AndroidStudio
  • In your project build.gradle file, under allprojects/repositories add the following and replace ${username} by the provided username and ${encrypted_password} by the provided encrypted password
maven {
    url "https://artifactory.datalf.chat/artifactory/app-consent-release"
    credentials {
        username = "${username}"
        password = "${encrypted_password}"
    }
}
  • You need to add the following in your app build.gradle
android.configurations {
        all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}

Usage

import RNAppConsent from 'react-native-app-consent';

RNAppConsent.start(String url);
RNAppConsent.presentGeoNoticeOnUserDemand(boolean userDemand, Promise promise);
RNAppConsent.presentNoticeOnUserDemand(boolean userDemand, Promise promise);
RNAppConsent.presentBannerOnUserDemand(boolean userDemand, Promise promise);
RNAppConsent.presentGeoBannerOnUserDemand(boolean userDemand, Promise promise);
RNAppConsent.isExtraPurposeAllowed(String purposeId, Promise promise);
RNAppConsent.isExtraVendorInPurposeAllowed(String vendorId, String purposeId, Promise promise);
RNAppConsent.shouldPresentGeolocationNoticeWithResolver();
RNAppConsent.shouldPresentNoticeWithResolver();
RNAppConsent.shouldPresentNoticesWithResolver();
RNAppConsent.subjectToGDPR(Promise promise);
RNAppConsent.cmpPresent(Promise promise);
RNAppConsent.consentString(Promise promise);
RNAppConsent.parsedVendors(Promise promise);
RNAppConsent.parsedPurposes(Promise promise);
RNAppConsent.setApplicationIcon(ReadableMap icon);
RNAppConsent.setNavigationBackImage(ReadableMap image);
RNAppConsent.setNoticeOnboardingImage(ReadableMap image);
RNAppConsent.setNoticeSuccessImage(ReadableMap image);
RNAppConsent.setNoticeInformationIcon(ReadableMap icon);
RNAppConsent.setGeoAdvertizingIcon(ReadableMap icon);

Keywords

react-native

FAQs

Package last updated on 18 Nov 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.