File tree 1 file changed +9
-0
lines changed
Sources/Segment/Plugins/Platforms/iOS 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -14,20 +14,29 @@ import UIKit
14
14
// MARK: - Remote Notifications
15
15
16
16
public protocol RemoteNotifications : Plugin {
17
+ func declinedRemoteNotifications( )
17
18
func registeredForRemoteNotifications( deviceToken: Data )
18
19
func failedToRegisterForRemoteNotification( error: Error ? )
19
20
func receivedRemoteNotification( userInfo: [ AnyHashable : Any ] )
20
21
func handleAction( identifier: String , userInfo: [ String : Any ] )
21
22
}
22
23
23
24
extension RemoteNotifications {
25
+ public func declinedRemoteNotifications( ) { }
24
26
public func registeredForRemoteNotifications( deviceToken: Data ) { }
25
27
public func failedToRegisterForRemoteNotification( error: Error ? ) { }
26
28
public func receivedRemoteNotification( userInfo: [ AnyHashable : Any ] ) { }
27
29
public func handleAction( identifier: String , userInfo: [ String : Any ] ) { }
28
30
}
29
31
30
32
extension Analytics {
33
+ public func declinedRemoteNotifications( ) {
34
+ apply { plugin in
35
+ if let p = plugin as? RemoteNotifications {
36
+ p. declinedRemoteNotifications ( )
37
+ }
38
+ }
39
+ }
31
40
public func registeredForRemoteNotifications( deviceToken: Data ) {
32
41
setDeviceToken ( deviceToken. hexString)
33
42
You can’t perform that action at this time.
0 commit comments