import { Linking } from "react-native";
최상단에서 Linking 을 가져온 뒤
<Styled.AlertButtonWrapper
onPress={() =>
Linking.openURL(`sms:112${SMSDivider}body=문자내용`)}
style={{ marginLeft: vw(19) }}>
<Styled.AlertButtonLabel>112 문자 신고</Styled.AlertButtonLabel>
</Styled.AlertButtonWrapper>
이렇게 onPress 이벤트와 연결시켜줍니다.
여기서 주목해야 하는 점이 (제가 이 글을 적고 있는 이유)
SMSDivider
입니다.
컴포넌트 최상단에 다음과 같은 상수 값을 선언해주세요
import { Linking, Platform } from 'react-native';
const SMSDivider: string = Platform.OS === 'android' ? '?' : '&';
aos와 ios는 이렇게 또 저희를 괴롭혔습니다.