React Native SDK
This is a step by step guide to include Conscent.ai package in your app. This package is developed in TypeScript and JavaScript.
yourClientId
Pass your clientId received from Conscent.ai
yourContentId
Unique id of each content
scroll-Y
Pass the scroll depth of your content screen
userAgent
Pass userAgent of your device
Mode
Mode can be set as :
STAGING
SANDBOX
LIVE
Initialize the paywall
Define these states on the content screen
const [scrollY, setScrollY] = useState(0);
const paywallRef = useRef(null);
const [showPaywall, setShowPaywall] = useState(true);
const [showContent, setShowContent] = useState(false);
const [mode, setMode] = useState('SANDBOX');Call the Paywall on top of your content screen
call removePage() in useFocusEffect
call onTouchListener() : when the user does any activity on the screen
Paywall Listener
Implement the onStatusChange method in your component
METERBANNER: when receiving it then unlock content and show the paywall
PAYWALL: when receiving it then lock the content and show the paywall
UNLOCK: when receiving it then unlock the content and don't show the paywall
Demo app Link
Last updated