import { Platform } from 'react-native'; import { initComponents } from '../utils/utils'; import { ContentsquareModule } from './nativeModules'; /** * Programatically starts the SDK. * * This method is automatically called on application start by default. The automatic * initialization can be controlled via the Android manifest or the Info.plist depending * on the platform. * * This method can be called manually if needed but it should be called as early as possible * in the application process. */ export const start = (): void => { ContentsquareModule.start(false); initComponents(); }; /** * Allows the Contentsquare SDK to monitor CS in-app activation through a custom URL scheme. * This method is only for iOS, it has no effect on Android. * * @param {string | null | undefined} urlString */ export const handleUrl = (urlString: string | null | undefined): void => { if (Platform.OS === 'ios') { ContentsquareModule.handleUrl(urlString); } };