diff --git a/server/.gitignore b/server/.gitignore index f0d3b8b..fa8e4a1 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -40,3 +40,4 @@ AuthKey_QLHFNT37VK.p8 application.properties application.yml Certificates.p12 +Certificates_prod.p12 diff --git a/server/src/main/java/com/yogit/server/config/APNsConfig.java b/server/src/main/java/com/yogit/server/config/APNsConfig.java index 7da85bf..13844c4 100644 --- a/server/src/main/java/com/yogit/server/config/APNsConfig.java +++ b/server/src/main/java/com/yogit/server/config/APNsConfig.java @@ -24,13 +24,13 @@ public ApnsClient someAppDevApnsClient(@Value("${APN.DEV.P12.PW}") String DEV_PW .build(); } -// @Bean -// public ApnsClient someAppProdApnsClient() throws IOException { -// // 배표용 인증 키 파일 -// return new ApnsClientBuilder() -// .setApnsServer(ApnsClientBuilder.PRODUCTION_APNS_HOST) -// .setClientCredentials(new ClassPathResource("some_app_prod_pkcs_12_file.p12").getInputStream(), "some_app_prod_password") -// .build(); -// } + @Bean + public ApnsClient someAppProdApnsClient(@Value("${APN.PROD.P12.PW}") String PROD_PW, @Value("${APN.PROD.CERTIFICATE.PATH}") String PROD_CERTIFICATE_PATH) throws IOException { + // 배표용 인증 키 파일 + return new ApnsClientBuilder() + .setApnsServer(ApnsClientBuilder.PRODUCTION_APNS_HOST) + .setClientCredentials(new ClassPathResource(PROD_CERTIFICATE_PATH).getInputStream(), PROD_PW) + .build(); + } }