Skip to content

Commit

Permalink
Merge pull request #14 from airrobe/eli/makeTelemetryEventFunctionPublic
Browse files Browse the repository at this point in the history
make telemetryEvent function publicly callable
  • Loading branch information
creative-dev-lab authored May 17, 2022
2 parents bab3251 + 40d1f03 commit bf33522
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Sources/AirRobeWidget/Resources/AirRobeStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ enum AirRobeStrings {

// MARK: - Order Activate baseURL
static let orderActivateBaseUrl = "https://shop.airrobe.com/en/orders/"
static let orderActivateSandBoxBaseUrl = "https://stg.marketplace.airdemo.link/en/orders/"

// MARK: - Delimiter
static let delimiter: String.Element = "/"
Expand Down
4 changes: 4 additions & 0 deletions Sources/AirRobeWidget/AirRobeWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public func initialize(config: AirRobeWidgetConfig) {
})
}

public func trackPageView(pageName: String) {
AirRobeUtils.telemetryEvent(eventName: "pageview", pageName: pageName)
}

public func checkMultiOptInEligibility(items: [String]) -> Bool {
guard !AirRobeShoppingDataModelInstance.shared.categoryMapping.categoryMappingsHashMap.isEmpty, !items.isEmpty else {
return false
Expand Down
1 change: 1 addition & 0 deletions Sources/AirRobeWidget/Utils/AirRobeUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Combine

private var cancellable: AnyCancellable?
struct AirRobeUtils {

static func openUrl(_ url: URL?) {
guard let url = url else {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final class AirRobeOrderConfirmationView: UIView, NibLoadable {
return
}
let url = URL(
string: "\(AirRobeStrings.orderActivateBaseUrl)\(configuration.appId)-\(viewModel.orderId)"
string: "\(configuration.mode == .production ? AirRobeStrings.orderActivateBaseUrl : AirRobeStrings.orderActivateSandBoxBaseUrl)\(configuration.appId)-\(viewModel.orderId)/claim"
)
guard let url = url else {
return
Expand Down

0 comments on commit bf33522

Please sign in to comment.