[🐛] 8차 푸시 확인

Signed-off-by: seonkyu.kim <sean.kk@daum.net>
This commit is contained in:
김선규 2024-11-30 11:29:56 +09:00
parent a5e1cbc347
commit aee9a805e0
2 changed files with 11 additions and 4 deletions

View File

@ -31,20 +31,24 @@ public class PushController : ControllerBase
[CustomOperation("푸시전송", "저장된 양식으로, 사용자에게 푸시를 전송한다.", "푸시")]
public async Task<IActionResult> 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";

View File

@ -17,7 +17,10 @@ public class PushServiceWithP12
public PushServiceWithP12(string keysFilePath, string p12Path, string apnsTopic)
{
var keys = JsonSerializer.Deserialize<Dictionary<string, string>>(File.ReadAllText(keysFilePath));
this.p12Password = keys["Password"];
// TEST
Console.WriteLine($"File Exists: {keys}");
p12Password = keys["Password"];
this.p12Path = p12Path;
this.apnsTopic = apnsTopic;
}