From e24a784709a3b170a59745949efdfdbe4dcea0a0 Mon Sep 17 00:00:00 2001 From: Matthias Ludwig Date: Sun, 16 Apr 2017 18:48:50 +0200 Subject: [PATCH] Simple, empty initializer --- Sources/VaporGCM/GCMPayload.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Sources/VaporGCM/GCMPayload.swift b/Sources/VaporGCM/GCMPayload.swift index 3d8fced..3ac8d32 100644 --- a/Sources/VaporGCM/GCMPayload.swift +++ b/Sources/VaporGCM/GCMPayload.swift @@ -11,6 +11,8 @@ import JSON ///Parameters for gcmPayload messaging by platform public struct GCMPayload { + // Simple, empty initializer + public init() {} //Indicates notification title. This field is not visible on iOS phones and tablets. public var title: String? //Indicates notification body text. @@ -70,3 +72,16 @@ public struct GCMPayload { return json } } + +public extension GCMPayload { + public init(message: String) { + self.init() + self.body = message + } + + public init(title: String, body: String) { + self.init() + self.title = title + self.body = body + } +}