Skip to content

Commit

Permalink
Merge pull request #9 from 3sidedcube/feature/silent_pushes
Browse files Browse the repository at this point in the history
Add capability for silent "content-available" push notifications
  • Loading branch information
MihaelIsaev authored Feb 20, 2019
2 parents da17cef + 7b7ca73 commit e2ac69b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Sources/FCM/FCMMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class FCMMessage<APNSPayload>: Codable where APNSPayload: FCMApnsPayloadP

/// Input only.
/// Basic notification template to use across all platforms.
public var notification: FCMNotification
public var notification: FCMNotification?

/// Input only.
/// Android specific options for messages sent through FCM connection server.
Expand All @@ -26,7 +26,7 @@ public class FCMMessage<APNSPayload>: Codable where APNSPayload: FCMApnsPayloadP
/// Input only.
/// Apple Push Notification Service specific options.
public var apns: FCMApnsConfig<APNSPayload>?

//MARK: - Union field target. Required. Input only. Target to send a message to. target can be only one of the following:

/// Registration token to send a message to.
Expand All @@ -37,10 +37,10 @@ public class FCMMessage<APNSPayload>: Codable where APNSPayload: FCMApnsPayloadP

/// Condition to send a message to, e.g. "'foo' in topics && 'bar' in topics".
public var condition: String?

/// Initialization with device token
public init(token: String,
notification: FCMNotification,
notification: FCMNotification?,
data: [String: String]? = nil,
name: String? = nil,
android: FCMAndroidConfig? = nil,
Expand All @@ -56,10 +56,10 @@ public class FCMMessage<APNSPayload>: Codable where APNSPayload: FCMApnsPayloadP
self.webpush = webpush
self.apns = apns
}

/// Initialization with topic
public init(topic: String,
notification: FCMNotification,
notification: FCMNotification?,
data: [String: String]? = nil,
name: String? = nil,
android: FCMAndroidConfig? = nil,
Expand All @@ -75,10 +75,10 @@ public class FCMMessage<APNSPayload>: Codable where APNSPayload: FCMApnsPayloadP
self.webpush = webpush
self.apns = apns
}

/// Initialization with condition
public init(condition: String,
notification: FCMNotification,
notification: FCMNotification?,
data: [String: String]? = nil,
name: String? = nil,
android: FCMAndroidConfig? = nil,
Expand All @@ -100,7 +100,7 @@ public class FCMMessage<APNSPayload>: Codable where APNSPayload: FCMApnsPayloadP
extension FCMMessage where APNSPayload == FCMApnsPayload {
/// Initialization with device token
public convenience init(token: String,
notification: FCMNotification,
notification: FCMNotification?,
data: [String: String]? = nil,
name: String? = nil,
android: FCMAndroidConfig? = nil,
Expand All @@ -116,7 +116,7 @@ extension FCMMessage where APNSPayload == FCMApnsPayload {

/// Initialization with topic
public convenience init(topic: String,
notification: FCMNotification,
notification: FCMNotification?,
data: [String: String]? = nil,
name: String? = nil,
android: FCMAndroidConfig? = nil,
Expand All @@ -132,7 +132,7 @@ extension FCMMessage where APNSPayload == FCMApnsPayload {

/// Initialization with condition
public convenience init(condition: String,
notification: FCMNotification,
notification: FCMNotification?,
data: [String: String]? = nil,
name: String? = nil,
android: FCMAndroidConfig? = nil,
Expand Down

0 comments on commit e2ac69b

Please sign in to comment.