Skip to content

Commit 7d02cb7

Browse files
bsneedBrandon Sneed
andauthored
Fixed Appsflyer plugin conformance issues. (#50)
Co-authored-by: Brandon Sneed <[email protected]>
1 parent 19460c3 commit 7d02cb7

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

Examples/destination_plugins/AppsFlyerDestination.swift

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private struct AppsFlyerSettings: Codable {
4545
}
4646

4747
@objc
48-
class AppsFlyerDestination: UIResponder, DestinationPlugin, RemoteNotifications, iOSLifecycle {
48+
class AppsFlyerDestination: UIResponder, DestinationPlugin {
4949
let timeline = Timeline()
5050
let type = PluginType.destination
5151
let key = "AppsFlyer"
@@ -55,7 +55,6 @@ class AppsFlyerDestination: UIResponder, DestinationPlugin, RemoteNotifications,
5555
fileprivate var settings: AppsFlyerSettings? = nil
5656

5757
public func update(settings: Settings) {
58-
5958
guard let settings: AppsFlyerSettings = settings.integrationSettings(forPlugin: self) else { return }
6059
self.settings = settings
6160

@@ -71,18 +70,6 @@ class AppsFlyerDestination: UIResponder, DestinationPlugin, RemoteNotifications,
7170
if trackAttributionData ?? false {
7271
AppsFlyerLib.shared().delegate = self
7372
}
74-
75-
func applicationDidBecomeActive(application: UIApplication) {
76-
AppsFlyerLib.shared().start()
77-
}
78-
79-
func openURL(_ url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) {
80-
AppsFlyerLib.shared().handleOpen(url, options: options)
81-
}
82-
83-
func receivedRemoteNotification(userInfo: [AnyHashable: Any]) {
84-
AppsFlyerLib.shared().handlePushNotification(userInfo)
85-
}
8673
}
8774

8875
public func identify(event: IdentifyEvent) -> IdentifyEvent? {
@@ -139,6 +126,20 @@ class AppsFlyerDestination: UIResponder, DestinationPlugin, RemoteNotifications,
139126
}
140127
}
141128

129+
extension AppsFlyerDestination: RemoteNotifications, iOSLifecycle {
130+
func applicationDidBecomeActive(application: UIApplication?) {
131+
AppsFlyerLib.shared().start()
132+
}
133+
134+
func openURL(_ url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) {
135+
AppsFlyerLib.shared().handleOpen(url, options: options)
136+
}
137+
138+
func receivedRemoteNotification(userInfo: [AnyHashable: Any]) {
139+
AppsFlyerLib.shared().handlePushNotification(userInfo)
140+
}
141+
}
142+
142143
//MARK: - UserActivities Protocol
143144

144145
extension AppsFlyerDestination: UserActivities {

0 commit comments

Comments
 (0)