@@ -15,18 +15,8 @@ protocol NotificationStateProviderProtocol {
15
15
16
16
struct SystemNotificationStateProvider : NotificationStateProviderProtocol {
17
17
func isNotificationsEnabled( withCallback callback: @escaping ( Bool ) -> Void ) {
18
- if #available( iOS 10 . 0 , * ) {
19
- UNUserNotificationCenter . current ( ) . getNotificationSettings { setttings in
20
- callback ( setttings. authorizationStatus == . authorized)
21
- }
22
- } else {
23
- // Fallback on earlier versions
24
- if let currentSettings = AppExtensionHelper . application? . currentUserNotificationSettings,
25
- currentSettings. types != [ ] {
26
- callback ( true )
27
- } else {
28
- callback ( false )
29
- }
18
+ UNUserNotificationCenter . current ( ) . getNotificationSettings { setttings in
19
+ callback ( setttings. authorizationStatus == . authorized)
30
20
}
31
21
}
32
22
@@ -45,7 +35,6 @@ public protocol NotificationResponseProtocol {
45
35
var userText : String ? { get }
46
36
}
47
37
48
- @available ( iOS 10 . 0 , * )
49
38
struct UserNotificationResponse : NotificationResponseProtocol {
50
39
var userInfo : [ AnyHashable : Any ] {
51
40
response. notification. request. content. userInfo
@@ -144,8 +133,7 @@ struct IterableAppIntegrationInternal {
144
133
}
145
134
146
135
/**
147
- * This method handles incoming Iterable notifications and actions for iOS < 10.
148
- * This also handles 'silent push' notifications for all iOS versions.
136
+ * This method handles'silent push' notifications
149
137
*
150
138
* - parameter application: UIApplication singleton object
151
139
* - parameter userInfo: Dictionary containing the notification data
@@ -166,23 +154,6 @@ struct IterableAppIntegrationInternal {
166
154
ITBError ( " messageId not found in 'remove' silent push " )
167
155
}
168
156
}
169
- } else {
170
- switch application. applicationState {
171
- case . active:
172
- break
173
- case . background:
174
- break
175
- case . inactive:
176
- if #available( iOS 10 , * ) {
177
- } else {
178
- // iOS 10+ notification actions are handled by userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:
179
- // so this should only be executed if iOS 10 is not available.
180
- performDefaultNotificationAction ( userInfo)
181
- }
182
- break
183
- @unknown default :
184
- break
185
- }
186
157
}
187
158
188
159
completionHandler ? ( . noData)
@@ -196,7 +167,6 @@ struct IterableAppIntegrationInternal {
196
167
* - parameter completionHandler: Completion handler passed from the original call. Iterable will call the completion handler
197
168
* automatically if you pass one. If you handle completionHandler in the app code, pass a nil value to this argument.
198
169
*/
199
- @available ( iOS 10 . 0 , * )
200
170
func userNotificationCenter( _: UNUserNotificationCenter ? , didReceive response: NotificationResponseProtocol , withCompletionHandler completionHandler: ( ( ) -> Void ) ? ) {
201
171
ITBInfo ( )
202
172
@@ -235,7 +205,6 @@ struct IterableAppIntegrationInternal {
235
205
completionHandler ? ( )
236
206
}
237
207
238
- @available ( iOS 10 . 0 , * )
239
208
private static func createIterableAction( actionIdentifier: String ,
240
209
userText: String ? ,
241
210
userInfo: [ AnyHashable : Any ] ,
@@ -284,7 +253,6 @@ struct IterableAppIntegrationInternal {
284
253
return foundButton ? [ JsonKey . ActionButton. action] as? [ AnyHashable : Any ]
285
254
}
286
255
287
- @available ( iOS 10 . 0 , * )
288
256
private static func createIterableDataFields( actionIdentifier: String , userText: String ? ) -> [ AnyHashable : Any ] {
289
257
var dataFields = [ AnyHashable: Any] ( )
290
258
0 commit comments