CommandersAct's TCConsent react native bridge
add the following dependencies into your package.json, and then install them using npm install
"tcconsent-react-native": "git+https://github.com/commandersact/tcconsent-react-native#*.*.*", #check latest available version
"tccore-react-native": "git+https://github.com/commandersact/tccore-react-native#*.*.*", #check latest available versionOnce the JS packages installed, you'll need to manually add the required pods to your Podfile:
pod "tccore-react-native-swift", :path => '../node_modules/@commandersact/tccore-react-native/tccore-react-native-swift.podspec'
pod "tcserverside-react-native-swift", :path => '../node_modules/@commandersact/tcserverside-react-native/tcserverside-react-native-swift.podspec'
check the demo app podfile here : https://github.com/CommandersAct/TCDemoReactNative/blob/master/ios/Podfile
After updating the Podfile, navigate to your ios/ directory and run:
pod install
This ensures that the native modules are correctly integrated into your Xcode project.
Depending on your use case, you may need one or multiple of these offline jsons in both of your android/iOS native app code.
- privacy.json [if you are planning on using our consent interface/ Privacy center]
- vendor-list.json if your are using IAB.
- purposes-xx.json if you are using IAB with a translation.
- google-atp-list.json if you wanna use ACString.
Your should have all of your necessary json files inside the assets folder of your main app module.
Make sure all your necessary json files are bundled with your app main bundle. Xcode target -> Build phases -> copy bundle ressources.
Usage will highly depend on your usecase. It is highly recommanded to have a look on the native SDK documentation for more insights and details. Android and iOS.
The follwing is a code sample for some main methodes of the library :
// imports ...
import * as TCConsent from 'tcconsent-react-native';
// Initialisation ..
TCConsent.setSiteIDPrivacyID(3311, 2929)
// Show privacy center
TCConsent.showPrivacyCenter()
// Accept consent directly without displaying the privacy center
TCConsent.acceptAllConsent()Check the following repo for a full working react-native app that integrates this library.
https://github.com/CommandersAct/TCDemoReactNative
On iOS, library linking can be fragile and files may easily break or become corrupted. If you encounter strange dependency issues, OBJ_CLASS$__ errors, or “not found” build failures, try the following steps:
1- Delete your node_modules folder
2- Remove package-lock.json
3- Close Xcode if it’s open
4- Run npm install to reinstall dependencies
5- Delete ios/Podfile.lock
6- Remove the ios/Pods folder
7- Ensure your Podfile is correctly configured—verify that required pods (e.g., pod "tccore-...") are properly declared
8- Run pod install inside the ios/ directory
8.1- In some cases, you may also need to open Xcode, clean the build folder, and run the app from the .xcworkspace file.
Support : support@commandersact.com
Commanders Act | 7b rue taylor - 75010 PARIS - France
