Skip to content

Migration to v5 queries #745

Open
Open
@Enricoza

Description

@Enricoza

I was migrating from v4 to v5 and had a couple quick questions for the team.

A general question regarding constants

  1. Why did you remove all of the constants? They were quite useful to avoid copy paste mistakes.

Regarding the URL Strategy

I'm unsure if I understood the changes correctly.

  1. Is the change from a strategy to an array of domains just due to the fact that some of the strategies have multiple domains (e.g. ADJUrlStrategyChina, ADJUrlStrategyIndia, ADJUrlStrategyCn) or could I pass now an array like this: ["eu.adjust.com", "tr.adjust.com"]?
  2. Are the other two parameters useSubdomains and isDataResidency fixed based on the array of domains passed in the first parameter? Or could I pass for example adjustConfig.setUrlStrategy(["eu.adjust.com"], useSubdomains: false, isDataResidency: false) or equivalently adjustConfig.setUrlStrategy(["adjust.net.in", "adjust.com"], useSubdomains: false, isDataResidency: true)?
  3. If they are fixed, why isn't that part of the AdjustSDK to infer or generate? Something like the following, for example, would avoid any possible confusion here:
public struct AdjustUrlStrategy {
    let domains: [String]
    let useSubdomains: Bool
    let isDataResidency: Bool
    public init(...) { ... }
}

public extension AdjustUrlStrategy {
    static let euResidency = AdjustUrlStrategy(domains: ["eu.adjust.com"], useSubdomains: true, isDataResidency: true)
    static let trResidency = AdjustUrlStrategy(domains: ["tr.adjust.com"], useSubdomains: true, isDataResidency: true)
    ...
    static let indiaStrategy = AdjustUrlStrategy(domains: ["adjust.net.in", "adjust.com"], useSubdomains: true, isDataResidency: false)
}

public class AdjustConfig {
    public func setUrlStrategy(_ strategy: AdjustUrlStrategy) { ... }
}

If this were to be implemented this way instead of the 5.0 version, it would give the same amount of parametrization in case some custom domain needs to be added but without the need for your customers to manually insert the ones that are already there, for example:

// standard strategy
adjustConfig.setUrlStrategy(.euResidency)
// or for custom strategy:
adjustConfig.setUrlStrategy(AdjustUrlStrategy(domains: ["my.custom.domain.com"], useSubdomains: false, isDataResidency: true))

Of course this only makes sense if the assumptions i made in point 1 to 3 are correct and there are some standard strategies.

TrackAdRevenue

For the trackAdRevenue a Data payload parameter was removed (as i can see from the code) but I can't find it in the migration guide. Should the payload be just removed or should it be passed in some other way?

Thank you very much for the support and for the migration guide which was very helpful so far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions