1
1
import Foundation
2
2
3
3
/// Retrieves feature announcements from the related endpoint
4
- public class AnnouncementServiceRemote : ServiceRemoteWordPressComREST {
4
+ open class AnnouncementServiceRemote : ServiceRemoteWordPressComREST {
5
5
6
- public func getAnnouncements( appId: String ,
6
+ open func getAnnouncements( appId: String ,
7
7
appVersion: String ,
8
8
locale: String ,
9
9
completion: @escaping ( Result < [ Announcement ] , Error > ) -> Void ) {
@@ -86,6 +86,18 @@ public struct Announcement: Codable {
86
86
public let isLocalized : Bool
87
87
public let responseLocale : String
88
88
public let features : [ Feature ]
89
+
90
+ public init ( appVersionName: String , minimumAppVersion: String , maximumAppVersion: String , appVersionTargets: [ String ] , detailsUrl: String , announcementVersion: String , isLocalized: Bool , responseLocale: String , features: [ Feature ] ) {
91
+ self . appVersionName = appVersionName
92
+ self . minimumAppVersion = minimumAppVersion
93
+ self . maximumAppVersion = maximumAppVersion
94
+ self . appVersionTargets = appVersionTargets
95
+ self . detailsUrl = detailsUrl
96
+ self . announcementVersion = announcementVersion
97
+ self . isLocalized = isLocalized
98
+ self . responseLocale = responseLocale
99
+ self . features = features
100
+ }
89
101
}
90
102
91
103
public struct Feature : Codable {
@@ -94,6 +106,14 @@ public struct Feature: Codable {
94
106
public let icons : [ FeatureIcon ] ?
95
107
public let iconUrl : String
96
108
public let iconBase64 : String ?
109
+
110
+ public init ( title: String , subtitle: String , icons: [ FeatureIcon ] ? , iconUrl: String , iconBase64: String ? ) {
111
+ self . title = title
112
+ self . subtitle = subtitle
113
+ self . icons = icons
114
+ self . iconUrl = iconUrl
115
+ self . iconBase64 = iconBase64
116
+ }
97
117
}
98
118
99
119
public struct FeatureIcon : Codable {
0 commit comments