Skip to content

Commit

Permalink
[CHORE] json 파일 log 추가 (#56)
Browse files Browse the repository at this point in the history
* [CHORE] 투표 ID 순으로 불러오기

* [FEAT] 팝업스토어 [내 정보 + TOP 5] 리스트 조회

* [FEAT] 사용자 리스트 조회할 때 총 리스트 정보 보내주기

* [FEAT] 사용자 리스트 조회 시 페이징처리

* [FEAT] 사업계획서에 따른 팝업스토어 상세 정보 보기

* [CHORE] 나의 팝업이 top5 에 들지 못했어도 찾기

* [FEAT] 채팅방 리스트 보여주기, 생성하기 RestController 로 변경

* [FEAT] 주석 추가

* [CHORE] 이름 추가

* [CHORE] preflight 추가

* [CHORE] preflight 추가

* [FIX] cors 해결

* [FIX] 컬렉션 오류 해결

* [FIX] 사업계획서 상세 조회 생성일 추가

* [FEAT] 채팅에 jwt 추가

* [CHORE] 필요없는 파일 삭제

* [CHORE] A페이지에서 채팅 보낼시 B페이지에서 내가 보낸 채팅으로 뜨는 문제 해결

* [FEAT] 알람 기능 추가

* [FEAT] firebase 정보 추가

* [CHORE] firebase 정보 확인

* [FIX] 파일 못찬는 문제 해결

* [FIX] 개행문자 처리

* [CHORE] json 파일 log 추가
  • Loading branch information
sangminee authored Mar 10, 2024
1 parent b420734 commit eef7f7d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/com/oya/kr/chat/config/FCMInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;

import javax.annotation.PostConstruct;
Expand Down Expand Up @@ -49,14 +50,19 @@ public void initialize() throws IOException {
Resource resource = resources[0];
if (!initialized) {
try {
GoogleCredentials googleCredentials = GoogleCredentials.fromStream(new ByteArrayInputStream(getJsonBytes(resource)))
byte[] jsonBytes = getJsonBytes(resource);
String jsonContent = new String(jsonBytes, StandardCharsets.UTF_8);

log.info("Firebase JSON 파일 내용:\n{}", jsonContent);

GoogleCredentials googleCredentials = GoogleCredentials.fromStream(new ByteArrayInputStream(jsonBytes))
.createScoped(Arrays.asList("https://www.googleapis.com/auth/cloud-platform"));
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(googleCredentials)
.build();
FirebaseApp.initializeApp(options);
initialized = true;
log.info("FCM 성공");
log.info("FCM 초기화 성공");
} catch (IOException e) {
log.info("FCM 오류");
log.error("FCM 오류 메시지: " + e.getMessage());
Expand Down

0 comments on commit eef7f7d

Please sign in to comment.