Skip to content

Commit

Permalink
hotfix: FCM Config 수정 2차
Browse files Browse the repository at this point in the history
  • Loading branch information
l2yujw committed Nov 29, 2024
1 parent d1b968d commit 74fb9bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/postman/bottler/config/FcmConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Base64;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -21,8 +22,11 @@ public class FcmConfig {
public void init() {
try {
// JSON 문자열을 InputStream으로 변환
System.out.println("privateKey: " + privateKey);
byte[] decodedBytes = Base64.getDecoder().decode(privateKey);
System.out.println("decodedBytes = " + Arrays.toString(decodedBytes));
InputStream serviceAccount = new ByteArrayInputStream(decodedBytes);
System.out.println("serviceAccount = " + serviceAccount.getClass());

FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ spring:
database-platform: org.hibernate.dialect.H2Dialect

fcm:
private-key: bottler-fcm.json
private-key: ${BOTTLER_FCM}

0 comments on commit 74fb9bb

Please sign in to comment.