[RN] react-native Linking 전화걸기, 문자, 메일보내기

2024. 5. 27. 10:12·React Native
반응형

전화걸기 기능 코드 이미지
전화걸기 기능

반응형

 

React-Native에서는 전화 기능을 구현하려면 Linking이라는 라이브러리를 사용해야 한다.

최상단에 Linking 라이브러리를 먼저 import해준다.

 

import { Linking } from 'react-native';

 

 

1. 전화걸기 기능

Linking.openURL(`tel:${전화번호 변수 or 지정할 전화번호}`)

 

 

2. 문자보내기 기능

Linking.openURL(`sms:${전화번호 변수 or 지정할 전화번호}`)

 

 

3 .메일보내기 기능

Linking.openURL(`mailto:${메일주소 변수 or 지정할 메일주소}`)

 

 

위와 같이 사용하면 iOS와 Android모두 정상작동한다.

반응형

'React Native' 카테고리의 다른 글

[RN] react-native 키보드 가림현상 - iOS  (0) 2024.05.29
[RN] react-native useRef 사용방법  (0) 2024.05.27
[RN] react-native ScrollView  (0) 2024.05.27
[RN] react-native, No bundle URL present. error (iOS)  (0) 2024.05.21
[RN] react-native Xcode Flipper error  (0) 2024.05.16
'React Native' 카테고리의 다른 글
  • [RN] react-native 키보드 가림현상 - iOS
  • [RN] react-native useRef 사용방법
  • [RN] react-native ScrollView
  • [RN] react-native, No bundle URL present. error (iOS)
nicee
nicee
답을 찾아가는 과정이 즐거운 프론트엔드 개발자의 기록모음🧐
    반응형
  • nicee
    나의 개발일지
    nicee
  • 글쓰기 관리
  • 전체
    오늘
    어제
    • 분류 전체보기
      • Project01 [Chat App]
      • React Native
      • Git
      • Program Setting
      • nicee-day
      • Study
        • C++
  • 블로그 메뉴

    • 링크

      • 🌳 git키우기
      • 📚 일상기록
    • 공지사항

    • 인기 글

    • 태그

      APP
      커피수혈
      React
      app build
      오블완
      Android
      Xcode
      채팅앱
      에러해결
      React-native
      백준코딩테스트
      앱개발
      불금
      nextjs
      빌드에러
      typescript
      k직장인
      공부
      k직장인일상
      리액트네이티브
      리액트
      직장인짤
      rn
      티스토리챌린지
      c++
      타입스크립트
      error
      firebase
      IOS
      next.js
    • 최근 댓글

    • 최근 글

    • hELLO· Designed By정상우.v4.10.0
    nicee
    [RN] react-native Linking 전화걸기, 문자, 메일보내기
    상단으로

    티스토리툴바