Skip to content

Fixed Appsflyer plugin conformance issues. #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions Examples/destination_plugins/AppsFlyerDestination.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private struct AppsFlyerSettings: Codable {
}

@objc
class AppsFlyerDestination: UIResponder, DestinationPlugin, RemoteNotifications, iOSLifecycle {
class AppsFlyerDestination: UIResponder, DestinationPlugin {
let timeline = Timeline()
let type = PluginType.destination
let key = "AppsFlyer"
Expand All @@ -55,7 +55,6 @@ class AppsFlyerDestination: UIResponder, DestinationPlugin, RemoteNotifications,
fileprivate var settings: AppsFlyerSettings? = nil

public func update(settings: Settings) {

guard let settings: AppsFlyerSettings = settings.integrationSettings(forPlugin: self) else { return }
self.settings = settings

Expand All @@ -71,18 +70,6 @@ class AppsFlyerDestination: UIResponder, DestinationPlugin, RemoteNotifications,
if trackAttributionData ?? false {
AppsFlyerLib.shared().delegate = self
}

func applicationDidBecomeActive(application: UIApplication) {
AppsFlyerLib.shared().start()
}

func openURL(_ url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) {
AppsFlyerLib.shared().handleOpen(url, options: options)
}

func receivedRemoteNotification(userInfo: [AnyHashable: Any]) {
AppsFlyerLib.shared().handlePushNotification(userInfo)
}
}

public func identify(event: IdentifyEvent) -> IdentifyEvent? {
Expand Down Expand Up @@ -139,6 +126,20 @@ class AppsFlyerDestination: UIResponder, DestinationPlugin, RemoteNotifications,
}
}

extension AppsFlyerDestination: RemoteNotifications, iOSLifecycle {
func applicationDidBecomeActive(application: UIApplication?) {
AppsFlyerLib.shared().start()
}

func openURL(_ url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) {
AppsFlyerLib.shared().handleOpen(url, options: options)
}

func receivedRemoteNotification(userInfo: [AnyHashable: Any]) {
AppsFlyerLib.shared().handlePushNotification(userInfo)
}
}

//MARK: - UserActivities Protocol

extension AppsFlyerDestination: UserActivities {
Expand Down