728x90

reactnative 설치 (xcode깔려있어야함.)

yarn ios 로 빌드 되는지 확인 !

 

 

빌드 fail경우 

cd ios

pod deintegrate (pods폴더 삭제)

pod cache clean --all (캐시 삭제)

(혹시 안되면 pod install --repo-update)

xcode preference에 들어가서 derived 폴더 안에 삭제. 

이거는 pod install 하면 다시 생김! 

(뭔말인지 모르겠으면 밑에 링크 참고)

 

yarn 

yarn ios

 

 

 

이제 

 

firebase project만들기

https://firebase.google.com/

 

Firebase

Firebase는 고품질 앱을 빠르게 개발하고 비즈니스를 성장시키는 데 도움이 되는 Google의 모바일 플랫폼입니다.

firebase.google.com

 

Add project

 

프로젝트 이름 넣고 

디폴트 내 계정으로 시작!

 

 

 

다음부터는 쭉 따라하면 되는데 

번들id는 xcode에서 가져와서 붙여넣기 하면 된다. 

(xcode에서 원하는 프로젝트파일 열고, 왼쪽의 프로젝트 파일 누르면 이거 뜸

General 들어가서 

Bundle Identifier 의 값을 복붙하면 됨다. )

 

 

 GoogleService-Info.plist 파일을 

firebase 프로젝트 만드는 곳에서 다운받아서

프로젝트 안에 넣는다 (위치는 거기서 알려줌.)

 

 

그다음에 

AppDelegate.m

에 

 

#import <Firebase.h>

와 

[FIRApp configure];

만 추가!

 

[FIRApp configure]; 이거는 (Bool)로 어플리케이션 실행하는 함수로 보이는 거 하단에 {} 넣어줌. 

위치는 마찬가지로 프로젝트 설명란에 있는데 각자 코드에 맞게 넣으면 된다..

 

 

특이점은 

appPackage를 다운받지 않았다. 

다음단계에서 링크로 들어가서 analytics다운 받는게 있는데 그걸 하지 않고

 

yarn add @react-native-firebase/app

yarn add @react-native-firebase/analytics

 

로 추가했다. (여기에 이미있다고함..)

 

 

아 그리고 analytics는 app과 같은 버전으로 맞춰줘야한다!

 

 

그리고 firebase.json파일을 보면

 

// <project-root>/firebase.json
{
  "react-native": {
    "analytics_auto_collection_enabled": false
  }
}

 

 

false로 꺼져있다.

잘은 모르겠지만 이게  GDPR compliance 정책상으로 꺼져있다고 한다.

앱실행될때 자동으로 집계하게끔 하는게 꺼져있는 것이다. 

대신 이벤트처리하듯

홈화면 들어갈 때 메서드를 이용해서 집계하는 방법을 쓰면 된다.

 

 

To re-enable analytics (e.g. once you have the users consent), call the setAnalyticsCollectionEnabled method:

import { firebase } from '@react-native-firebase/analytics';
// ...
await firebase.analytics().setAnalyticsCollectionEnabled(true);

https://rnfirebase.io/analytics/usage

 

Analytics | React Native Firebase

Copyright © 2017-2020 Invertase Limited. Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. Some partial documentation, under the

rnfirebase.io

 

 

프로젝트 예시 홈화면 들어갈때 추가되도록 했다. 

  const activateAnalytics = async () => {
    await firebase.analytics().setAnalyticsCollectionEnabled(true)
  }
  useEffect(() => {
    activateAnalytics()
  }, [])

 

 

 

 

 

 

 

 

 

 

에러 해결방법 참고한 것들

https://developer.apple.com/forums/thread/703823

 

Xcode 13.3 spits "Requested but di… | Apple Developer Forums

MrtnFbg's answer inspired me to read more about redirections of streams. So I read about Linux STDOUT STDERR. In this specific case when I run this command, there is an output and there are some errors. Since I ran this command on terminal and on terminal

developer.apple.com

https://positiveko-til.vercel.app/til/react-native/error65.html

 

에러 해결🔑 error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. | Positiveko

에러 해결🔑 error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. 리액트 네이티브에서 가장 유명한 에러가 아닐까.. (아니 나참.. 리네 = 에러 픽스 90 + 개발 10 같다.. 후) 이

positiveko-til.vercel.app

 

 

 

 

 

https://rnfirebase.io/analytics/usage

 

Analytics | React Native Firebase

Copyright © 2017-2020 Invertase Limited. Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. Some partial documentation, under the

rnfirebase.io

 

728x90

+ Recent posts