Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

[IP-549] [Telemetry] Add subscription type to environment signa

  • Loading branch information
Pavel authored and pavel-cliqz committed Jun 5, 2019
1 parent be80d8a commit 89f8f2ab82b57da01eaed9eb6f1d3b88b603da8d
@@ -298,7 +298,7 @@ extension TrackersController: UITableViewDataSource, UITableViewDelegate {
cell.infoButtonAction = { [weak self] (button, trackerName) in
var url = "https://whotracks.me/tracker-not-found.html"
if let t = trackerName {
if let d = Engine.sharedInstance.getBridge().callAction("mobile-cards:getTrackerDetails", args: [t.lowercased()]) as? [String: Any],
if let d = Engine.sharedInstance.getBridge().callAction("insights:getTrackerDetails", args: [t.lowercased()]) as? [String: Any],
let result = d["result"] as? [String: String],
let wtm = result["wtm"] {
url = "https://whotracks.me/trackers/\(wtm).html"
@@ -84,6 +84,7 @@ open class Engine {
}
#if PAID
params["lumen.protection.isEnabled"] = UserPreferences.instance.isProtectionOn
params["lumen.subscription"] = SubscriptionController.shared.getCurrentSubscription().description()
#endif
Engine.sharedInstance.getBridge().publishEvent("mobile-browser:notify-preferences", args: [params])
}
@@ -40,4 +40,22 @@ public enum LumenSubscriptionType {
return premiumType.hasVPN() ? "plus" : "basic"
}
}

func description() -> String {
switch self {
case .limited:
return "free"
case .trial(_):
return "trial"
case .premium(let premiumType, _):
switch premiumType {
case .basic(_):
return "basic"
case .basicAndVpn(_):
return "basic_vpn"
case .vpn(_):
return "vpn"
}
}
}
}

Some generated files are not rendered by default. Learn more.

@@ -24,8 +24,8 @@
"@babel/runtime": "^7.2.0",
"@cliqz/indexeddbshim": "^4.1.2",
"appium": "1.9.0",
"browser-core": "https://s3.amazonaws.com/cdncliqz/update/edge/ghostery-ios/v3.36/1.36.0.ae0e3c1.tgz",
"browser-core-lumen-ios": "https://s3.amazonaws.com/cdncliqz/update/edge/lumen-ios/v3.36/13.36.0.ae0e3c1.tgz",
"browser-core": "https://s3.amazonaws.com/cdncliqz/update/edge/ghostery-ios/v3.36/1.36.0.43bc38c.tgz",
"browser-core-lumen-ios": "https://s3.amazonaws.com/cdncliqz/update/edge/lumen-ios/v3.36/13.36.0.43bc38c.tgz",
"buffer": "5.0.7",
"https-browserify": "1.0.0",
"page-metadata-parser": "^1.1.2",

0 comments on commit 89f8f2a

Please sign in to comment.