Skip to content

Commit a142abe

Browse files
committed
Remove unnecessary init
1 parent 2d41546 commit a142abe

File tree

1 file changed

+14
-56
lines changed

1 file changed

+14
-56
lines changed

Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotification.swift

+14-56
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ public struct APNSStartLiveActivityNotification<Attributes: Encodable, ContentSt
9898
/// - expiration: The date when the notification is no longer valid and can be discarded.
9999
/// - priority: The priority of the notification.
100100
/// - appID: Your app’s bundle ID/app ID. This will be suffixed with `.push-type.liveactivity`.
101-
/// - apnsID: A canonical UUID that identifies the notification.
102101
/// - contentState: Updated content-state of live activity
103102
/// - timestamp: Timestamp when sending notification
104103
/// - dismissalDate: Timestamp when to dismiss live notification when sent with `end`, if in the past
105104
/// dismiss immediately
105+
/// - apnsID: A canonical UUID that identifies the notification.
106106
/// - attributes: The ActivityAttributes of the live activity to start
107-
/// - attributesString: The type name of the ActivityAttributes you want to send
107+
/// - attributesType: The type name of the ActivityAttributes you want to send
108108
/// - alert: An alert that will be sent along with the notification
109109
public init(
110110
expiration: APNSNotificationExpiration,
@@ -118,59 +118,17 @@ public struct APNSStartLiveActivityNotification<Attributes: Encodable, ContentSt
118118
attributesType: String,
119119
alert: APNSAlertNotificationContent
120120
) {
121-
self.init(
122-
expiration: expiration,
123-
priority: priority,
124-
topic: appID + ".push-type.liveactivity",
125-
contentState: contentState,
126-
timestamp: timestamp,
127-
dismissalDate: dismissalDate,
128-
attributes: attributes,
129-
attributesType: attributesType,
130-
alert: alert
131-
)
132-
}
133-
134-
/// Initializes a new ``APNSStartLiveActivityNotification``.
135-
///
136-
/// - Important: Your dynamic payload will get encoded to the root of the JSON payload that is send to APNs.
137-
/// It is **important** that you do not encode anything with the key `aps`
138-
///
139-
/// - Parameters:
140-
/// - expiration: The date when the notification is no longer valid and can be discarded.
141-
/// - priority: The priority of the notification.
142-
/// - topic: The topic for the notification. In general, the topic is your app’s bundle ID/app ID suffixed with `.push-type.liveactivity`.
143-
/// - apnsID: A canonical UUID that identifies the notification.
144-
/// - contentState: Updated content-state of live activity
145-
/// - timestamp: Timestamp when sending notification
146-
/// - dismissalDate: Timestamp when to dismiss live notification when sent with `end`, if in the past
147-
/// dismiss immediately
148-
/// - attributes: The ActivityAttributes of the live activity to start
149-
/// - attributesString: The type name of the ActivityAttributes you want to send
150-
/// - alert: An alert that will be sent along with the notification
151-
public init(
152-
expiration: APNSNotificationExpiration,
153-
priority: APNSPriority,
154-
topic: String,
155-
apnsID: UUID? = nil,
156-
contentState: ContentState,
157-
timestamp: Int,
158-
dismissalDate: APNSLiveActivityDismissalDate = .none,
159-
attributes: Attributes,
160-
attributesType: String,
161-
alert: APNSAlertNotificationContent
162-
) {
163-
self.aps = APNSStartLiveActivityNotificationAPSStorage(
164-
timestamp: timestamp,
165-
contentState: contentState,
166-
dismissalDate: dismissalDate.dismissal,
167-
alert: alert,
168-
attributes: attributes,
169-
attributesType: attributesType
170-
)
171-
self.apnsID = apnsID
172-
self.expiration = expiration
173-
self.priority = priority
174-
self.topic = topic
121+
self.aps = APNSStartLiveActivityNotificationAPSStorage(
122+
timestamp: timestamp,
123+
contentState: contentState,
124+
dismissalDate: dismissalDate.dismissal,
125+
alert: alert,
126+
attributes: attributes,
127+
attributesType: attributesType
128+
)
129+
self.apnsID = apnsID
130+
self.expiration = expiration
131+
self.priority = priority
132+
self.topic = appID + ".push-type.liveactivity"
175133
}
176134
}

0 commit comments

Comments
 (0)