React-Native 2

React-native 네이티브(Android)와 통신하기(eventEmitter)

블루투스 스캔 기능 구현하다가 npm에 있는 라이브러리들이 별로라 직접 구현하기로 했다. 스캔 결과를 React-native 쪽으로 던져줘야해서 EventEmitter 사용하여 구현하던 중에 React-native로 데이터를 던지면 에러가 뿅뿅 발생 했다. NativeModule에서 Service(백그라운드에서도 동작해야 해서)를 실행하여 Service에서 EventEmitter 통해 React-native로 스캔 결과를 던져주는 순서로 구현을 해놨는데 Service에서 생성한 ReactContext를 잘못 생성해줘서 생긴 에러였다. 기존 코드 // Activity Context로 생성하면 안됨 (NullPointerException) ReactContext reactContext = new ReactC..

Mobile/React-Native 2023.02.23

iOS FCM 푸시 알림 #2 - APNs 등록 및 앱 설정

Apple Developer Identifiers APNs 활성화 apple developer에 로그인 후 왼쪽 메뉴에서 Identifiers 클릭 https://developer.apple.com/account/resources APNs 활성화 시킬 앱 클릭 Push notifications 체크 우측 상단 save 클릭 p8 키 발급 왼쪽 메뉴에서 Keys 클릭 Keys 옆 플러스 버튼 클릭 이름 입력, Apple Push Notifications service(APNs) 체크 후 continue 클릭 다운로드 클릭 (페이지 나간 후엔 다운로드 받을 수 없으니 무조건 다운로드) FCM 프로젝트에 APN 인증 키 등록 이전에 만든 FCM 프로젝트 설정 페이지로 이동 클라우드 메세징 탭 클릭 Apple ..

Mobile/iOS 2023.01.17
728x90