From aee9a805e0e9a65a86ca7e1b82708bde204bc6fe Mon Sep 17 00:00:00 2001 From: "seonkyu.kim" Date: Sat, 30 Nov 2024 11:29:56 +0900 Subject: [PATCH] =?UTF-8?q?[=F0=9F=90=9B]=208=EC=B0=A8=20=ED=91=B8?= =?UTF-8?q?=EC=8B=9C=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: seonkyu.kim --- Program/V1/Controllers/PushController.cs | 10 +++++++--- Program/V1/Services/PushService.cs | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Program/V1/Controllers/PushController.cs b/Program/V1/Controllers/PushController.cs index 8cdeeb6..ed094b0 100644 --- a/Program/V1/Controllers/PushController.cs +++ b/Program/V1/Controllers/PushController.cs @@ -31,20 +31,24 @@ public class PushController : ControllerBase [CustomOperation("푸시전송", "저장된 양식으로, 사용자에게 푸시를 전송한다.", "푸시")] public async Task SendPush(string deviceToken, string title, string body, int badge) { - var keysFilePath = "/volume1/AcaMate/PROJECT/Application/Back/private/appleKeys.json"; + var keysFilePath = "/src/private/appleKeys.json"; var uri = ""; var p12FilePath = ""; if (_env.IsDevelopment()) { + // TEST + Console.WriteLine($"Current Directory: {Environment.CurrentDirectory}"); + Console.WriteLine($"Keys File Path: /src/private/appleKeys.json"); + uri = "https://api.sandbox.push.apple.com"; - p12FilePath = "/volume1/AcaMate/PROJECT/Application/Back/private/AM_Push_Sandbox.p12"; + p12FilePath = "/src/private/AM_Push_Sandbox.p12"; // p12FilePath = "private/AM_Push_Sandbox.p12"; } else { uri = "https://api.push.apple.com"; - p12FilePath = "/volume1/AcaMate/PROJECT/Application/Back/private/AM_Push.p12"; + p12FilePath = "/src/private/AM_Push.p12"; // p12FilePath = "private/AM_Push.p12"; } var apnsTopic = "me.myds.ipstien.acamate.AcaMate"; diff --git a/Program/V1/Services/PushService.cs b/Program/V1/Services/PushService.cs index be459da..55f5631 100644 --- a/Program/V1/Services/PushService.cs +++ b/Program/V1/Services/PushService.cs @@ -17,7 +17,10 @@ public class PushServiceWithP12 public PushServiceWithP12(string keysFilePath, string p12Path, string apnsTopic) { var keys = JsonSerializer.Deserialize>(File.ReadAllText(keysFilePath)); - this.p12Password = keys["Password"]; + // TEST + Console.WriteLine($"File Exists: {keys}"); + + p12Password = keys["Password"]; this.p12Path = p12Path; this.apnsTopic = apnsTopic; } -- 2.45.1