Compare commits

..

No commits in common. "a77ae1baedfc9d962313efaecce6108ced315d2d" and "98d8263e3d766d132f5e12e0e712e700433d84d4" have entirely different histories.

2 changed files with 4 additions and 11 deletions

View File

@ -31,24 +31,20 @@ public class PushController : ControllerBase
[CustomOperation("푸시전송", "저장된 양식으로, 사용자에게 푸시를 전송한다.", "푸시")]
public async Task<IActionResult> SendPush(string deviceToken, string title, string body, int badge)
{
var keysFilePath = "/src/private/appleKeys.json";
var keysFilePath = "/volume1/AcaMate/PROJECT/Application/Back/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 = "/src/private/AM_Push_Sandbox.p12";
p12FilePath = "/volume1/AcaMate/PROJECT/Application/Back/private/AM_Push_Sandbox.p12";
// p12FilePath = "private/AM_Push_Sandbox.p12";
}
else
{
uri = "https://api.push.apple.com";
p12FilePath = "/src/private/AM_Push.p12";
p12FilePath = "/volume1/AcaMate/PROJECT/Application/Back/private/AM_Push.p12";
// p12FilePath = "private/AM_Push.p12";
}
var apnsTopic = "me.myds.ipstien.acamate.AcaMate";

View File

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