Skip to content

Commit

Permalink
Add push type header field
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio Tacke authored and code28 committed Oct 4, 2019
1 parent db71b41 commit df1c063
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/Gorush/GorushNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ public struct GorushNotification: Encodable {
case android = 2
}

public enum PushType: String, Content {
case alert
case background
}

let tokens: [String]
let platform: Platform
let topic: String
let push_type: PushType?

let message: String
let title: String?
Expand All @@ -37,10 +43,11 @@ public struct GorushNotification: Encodable {
let data: AnyEncodable?
let content_available: Bool?

public init(tokens: [String], platform: GorushNotification.Platform, message: String, title: String? = nil, alert: GorushNotification.iosAlertPayload? = nil, data: Encodable? = nil, content_available: Bool? = nil, topic: String = "") {
public init(tokens: [String], platform: GorushNotification.Platform, message: String, title: String? = nil, alert: GorushNotification.iosAlertPayload? = nil, data: Encodable? = nil, content_available: Bool? = nil, topic: String = "", pushType: PushType? = nil) {
self.tokens = tokens
self.platform = platform
self.topic = topic
self.push_type = pushType
self.message = message
self.title = title
self.alert = alert
Expand Down

0 comments on commit df1c063

Please sign in to comment.