jiangjc 1 month ago
parent
commit
d1f1d04cc3

+ 3 - 3
OASystem/OASystem.Api/OAMethodLib/APNs/APNsLib.cs

@@ -5,11 +5,11 @@ namespace OASystem.API.OAMethodLib.APNs
     {
         private static readonly IAPNsService _APNsService = AutofacIocManager.Instance.GetService<IAPNsService>();
 
-        public static bool pushMsg(string apnsTopic, string deviceToken, NotificationType type, string title, string subtitle, string body)
+        public static async Task<Result> pushMsg(string apnsTopic, string deviceToken, NotificationType type, string title, string subtitle, string body)
         {
-            _APNsService.PushNotification(apnsTopic, deviceToken, type, title, subtitle, body);
+            Result rst = await _APNsService.PushNotification(apnsTopic, deviceToken, type, title, subtitle, body);
 
-            return true;
+            return rst;
         }
     }
 }

+ 4 - 4
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -4445,14 +4445,14 @@ namespace OASystem.API.OAMethodLib
 
         #region iOS推送通知
 
-        public static async Task<bool> iOS_PushNotifications(string Numbers, string title, string subtitle, string body)
+        public static async Task<Result> iOS_PushNotifications(string Numbers, string title, string subtitle, string body)
         {
             var rst = await _deviceTokenRep.Query(s => s.Number == Numbers).SingleAsync();
-
+            Result rst2 = new Result() { Code = -1, Msg = "" };
             if (rst != null) {
-                APNsLib.pushMsg("com.panamerican.oa2024", rst.DeviceToken, NotificationType.Alert, title, subtitle, body);
+                rst2 = await APNsLib.pushMsg("com.panamerican.oa2024", rst.DeviceToken, NotificationType.Alert, title, subtitle, body);
             }
-            return false;
+            return rst2;
         }