Files
purchases-ios/Sources/Attribution/AttributionNetwork.swift
T
343ba7eaf4 AdServices (#1727)
* [CF-106] Fetch AdServices Token (#1519)

Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
Co-authored-by: Josh Holtz <me@joshholtz.com>

* [CF-553] Post AdServices token (#1534)

Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
Co-authored-by: Josh Holtz <me@joshholtz.com>

* Update ios 14 snapshots tets

* Reworked adservices to use new Purchases.shared.attribution API

* Updated with some comments from PR

* Add iAd code back (#1739)

Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>

* use new mapKeys dictionary extension for device cache

* update for some pr comments

* remove purchasestests

* generate missing snapshots

* fix deprecation messages to clarify method now called on shared instance

* Fix for inserting nonstring into userdefaults

* Add tests for bug

* fix lint

* Added availablility checks for tests and removed unused varialbes

* Whoops... wrong class

Co-authored-by: beylmk <maddie@revenuecat.com>
Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
2022-08-08 07:42:42 -05:00

84 lines
1.5 KiB
Swift

//
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// AttributionNetwork.swift
//
// Created by Joshua Liebowitz on 7/1/21.
//
import Foundation
/**
Enum of supported attribution networks
*/
@objc(RCAttributionNetwork) public enum AttributionNetwork: Int {
/**
Apple's search ads
*/
@available(*, deprecated, message: "use adServices")
case appleSearchAds = 0
/**
Adjust https://www.adjust.com/
*/
case adjust = 1
/**
AppsFlyer https://www.appsflyer.com/
*/
case appsFlyer = 2
/**
Branch https://www.branch.io/
*/
case branch = 3
/**
Tenjin https://www.tenjin.io/
*/
case tenjin = 4
/**
Facebook https://developers.facebook.com/
*/
case facebook = 5
/**
mParticle https://www.mparticle.com/
*/
case mParticle = 6
/**
AdServices token
*/
case adServices = 7
}
extension AttributionNetwork: Encodable {
// swiftlint:disable:next missing_docs
public func encode(to encoder: Encoder) throws {
try self.rawValue.encode(to: encoder)
}
}
extension AttributionNetwork {
var isAppleSearchAdds: Bool {
switch self {
case .appleSearchAds: return true
default: return false
}
}
}