Skip to content

Commit

Permalink
Add priority
Browse files Browse the repository at this point in the history
  • Loading branch information
code28 committed Nov 21, 2019
1 parent 97ab80b commit 7df9a6a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ iOSInjectionProject/
Packages
xcuserdata
*.xcodeproj
.swiftpm

### Xcode ###
# Xcode
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.0
// swift-tools-version:5.1

import PackageDescription

Expand Down
9 changes: 8 additions & 1 deletion Sources/Gorush/GorushNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ public struct GorushNotification: Encodable {
case background
}

public enum Priority: String, Content {
case normal
case high
}

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

let message: String?
let title: String?
Expand All @@ -43,11 +49,12 @@ 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 = "", pushType: PushType? = nil) {
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, priority: Priority? = nil) {
self.tokens = tokens
self.platform = platform
self.topic = topic
self.push_type = pushType
self.priority = priority
self.message = message
self.title = title
self.alert = alert
Expand Down
2 changes: 1 addition & 1 deletion Tests/GorushTests/GorushTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import XCTest

final class GorushTests: XCTestCase {
func testExample() {
XCTAssertEqual(Gorush().text, "Hello, World!")

}

static var allTests = [
Expand Down

0 comments on commit 7df9a6a

Please sign in to comment.