import { SmartechPushProps } from "./smartechPushProps"; const TAG = "SmartechPushExpoPlugin"; export const validateSmartechPushProps = (props: SmartechPushProps) => { // Validate iOS config if (typeof props.ios.groupIdentifier !== 'string') { throw new Error(`${TAG}iOS config property "groupIdentifier" is required and must be a string.`); } if (typeof props.ios.mode !== 'string') { throw new Error(`${TAG}iOS config property "mode" is required and must be a string.`); } // Validate optional swiftVersion if (props.ios.swiftVersion && typeof props.ios.swiftVersion !== 'string') { throw new Error(`${TAG}iOS config property "swiftVersion" must be a string if provided.`); } // Validate Android config if (typeof props.android.isKotlinProject !== 'boolean') { throw new Error(`{TAG} Android config property "isKotlinProject" is required and must be a boolean.`); } if (typeof props.android.useSmartechFCM !== 'boolean') { throw new Error(`{TAG} Android config property "useSmartechFCM" is required and must be a boolean.`); } if (typeof props.android.SMARTECH_PUSH_SDK_VERSION !== 'string') { throw new Error(`{TAG} Android config property "SMARTECH_PUSH_SDK_VERSION" is required and must be a string.`); } }