Skip to content

Commit

Permalink
Move app from install params to subscription update params.
Browse files Browse the repository at this point in the history
  • Loading branch information
Денис Андрейчук committed Oct 19, 2020
1 parent 64255aa commit ca01c56
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 1 addition & 4 deletions Sources/API/InstallParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ struct InstallParameters {
// MARK: - Properties

public let coupon: String
public let app: Int
public let screen: String
public let clickID: String?

// MARK: - Initialization

public init(coupon: String, app: Int, screen: String, clickID: String?) {
public init(coupon: String, screen: String, clickID: String?) {
self.coupon = coupon
self.app = app
self.screen = screen
self.clickID = clickID
}
Expand All @@ -35,7 +33,6 @@ extension Binom.InstallParameters {
var json: Parameters {
var params = Parameters()
params["coupon"] = coupon
params["app"] = app
params["screen"] = screen
params["clickid"] = clickID
return params
Expand Down
5 changes: 5 additions & 0 deletions Sources/API/SubscriptionUpdateParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ import Foundation

public extension Binom {
struct SubscriptionUpdateParameters {

// MARK: - Properties

let uuid: Int
let receipt: String
let subscription: String
let screenID: String
let app: Int
}}

extension Binom.SubscriptionUpdateParameters {
Expand All @@ -24,6 +28,7 @@ extension Binom.SubscriptionUpdateParameters {
params["receipt"] = receipt
params["last_period"] = subscription
params["screen"] = screenID
params["app"] = app
return params
}
}
4 changes: 2 additions & 2 deletions Sources/BinomManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public final class BinomManager {
if let coupon = coupon, let clickID = clickID, screens.count > 0 {
params = Binom.InstallParameters(
coupon: coupon,
app: app,
screen: screens.joined(separator: "|"),
clickID: clickID
)
Expand Down Expand Up @@ -120,7 +119,8 @@ public final class BinomManager {
uuid: uuid,
receipt: receipt,
subscription: subscription,
screenID: screenID
screenID: screenID,
app: app
)

provider.updateSubscription(params) { (requestResult) in
Expand Down

0 comments on commit ca01c56

Please sign in to comment.