From 326db91413d9a334a7f6a5734a319002bec55c02 Mon Sep 17 00:00:00 2001 From: Ben Myers Date: Wed, 7 Sep 2022 22:13:50 -0700 Subject: [PATCH] =?UTF-8?q?=E2=8C=A8=EF=B8=8F=20New=20messaging=20initiali?= =?UTF-8?q?zer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Cloud Messaging/MessagingNotification.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Sources/EasyFirebase/Services/Cloud Messaging/MessagingNotification.swift b/Sources/EasyFirebase/Services/Cloud Messaging/MessagingNotification.swift index 98146cf..bc113ec 100644 --- a/Sources/EasyFirebase/Services/Cloud Messaging/MessagingNotification.swift +++ b/Sources/EasyFirebase/Services/Cloud Messaging/MessagingNotification.swift @@ -56,6 +56,21 @@ public class MessagingNotification: Model, Equatable { // MARK: - Public Initalizers + public init(title: String, + body: String, + from user: T, + in category: MessageCategory, + attach image: URL? = nil, + key: String? = nil + ) where T: EasyUser { + self.user = user.id + self.title = title + self.body = body + self.category = category + self.image = image + self.key = key + } + public init(_ message: String, from user: T, in category: MessageCategory,