Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Adding Subscribe type callout VPN subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
soner-yuksel committed Jul 7, 2023
1 parent ec00499 commit 171e7eb
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ extension BrowserViewController {

// Priority: P3A - Bottom Bar - VPN - Default Browser - Rewards - Cookie Notification - Link Receipt
func presentFullScreenCallouts() {
presentVPNChurnPromoCallout(for: .autoRenewSoonExpire)
for type in FullScreenCalloutType.allCases {
presentScreenCallout(for: type)
}
}

private func presentScreenCallout(for type: FullScreenCalloutType, skipSafeGuards: Bool = false) {
Expand Down
38 changes: 36 additions & 2 deletions Sources/BraveStrings/BraveStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2955,8 +2955,7 @@ extension Strings {
NSLocalizedString("vpn.vpnRegionSelectorButtonSubTitle", tableName: "BraveShared", bundle: .module,
value: "Current Setting: %@",
comment: "Button subtitle for VPN region selection in menu. %@ will be replaced with country name or automatic ex: Current Setting: Automatic")



public static let autoRenewSoonExpirePopOverTitle =
NSLocalizedString("vpn.autoRenewSoonExpireTitle", tableName: "BraveShared", bundle: .module,
value: "Oh no! Your Brave VPN subscription is about to expire.",
Expand Down Expand Up @@ -3011,6 +3010,41 @@ extension Strings {
NSLocalizedString("vpn.updatePaymentActionButtonTitle", tableName: "BraveShared", bundle: .module,
value: "Update Payment",
comment: "Action button title that updates method payment")

public static let subscribeVPNActionButtonTitle =
NSLocalizedString("vpn.subscribeVPNActionButtonTitle", tableName: "BraveShared", bundle: .module,
value: "Subscribe Now",
comment: "Action button title that subscribe action for VPN purchase")

public static let subscribeVPNDiscountPopOverTitle =
NSLocalizedString("vpn.subscribeVPNDiscountPopOverTitle", tableName: "BraveShared", bundle: .module,
value: "Give Brave VPN another try and get 20% off for 3 months!",
comment: "Pop up title for subscribing VPN with discount")

public static let subscribeVPNProtectionPopOverTitle =
NSLocalizedString("vpn.subscribeVPNProtectionPopOverTitle", tableName: "BraveShared", bundle: .module,
value: "Did you know that Brave VPN protects you outside of Brave Browser?",
comment: "Pop up title for subscribing VPN explaning VPN protects user outside the Brave")

public static let subscribeVPNAllDevicesPopOverTitle =
NSLocalizedString("vpn.subscribeVPNAllDevicesPopOverTitle", tableName: "BraveShared", bundle: .module,
value: "Now, use Brave VPN on all your devices for the same price!",
comment: "Pop up title the subscription for VPN can be used for all platforms")

public static let subscribeVPNProtectionPopOverDescription =
NSLocalizedString("vpn.subscribeVPNProtectionPopOverDescription", tableName: "BraveShared", bundle: .module,
value: "Brave VPN has always blocked trackers on every app, even outside the Brave browser. Now you can see who tried to track you, with the Brave Privacy Hub.",
comment: "Pop up description for subscribing VPN explaning VPN protects user outside the Brave")

public static let subscribeVPNAllDevicesPopOverDescription =
NSLocalizedString("vpn.subscribeVPNAllDevicesPopOverDescription", tableName: "BraveShared", bundle: .module,
value: "That’s right. Your Brave VPN subscription is now good on up to 5 devices. So you can subscribe on iOS and use it on your Mac, Windows and Android devices for free.",
comment: "Pop up description the subscription for VPN can be used for all platforms")

public static let subscribeVPNPopOverSubDescription =
NSLocalizedString("vpn.subscribeVPNPopOverSubDescription", tableName: "BraveShared", bundle: .module,
value: "Ready to safeguard every app on your phone? Come back to Brave VPN and get 20% off for the next 3 months.",
comment: "Pop up sub description the subscription for VPN can be used for all platforms")
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "Illustration@2x 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "Illustration@3x 1.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 26 additions & 3 deletions Sources/Onboarding/VPNNotifications/VPNChurnPromoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public enum VPNChurnPromoType {
case autoRenewFreeMonth
case updateBillingSoonExpire
case updateBillingExpired

case subscribeDiscount
case subscribeVPNProtection
case subscribeAllDevices

var promoImage: String {
switch self {
case .autoRenewSoonExpire:
Expand All @@ -26,6 +29,12 @@ public enum VPNChurnPromoType {
return "auto_renew _free_image"
case .updateBillingSoonExpire, .updateBillingExpired:
return "update_billing_expired"
case .subscribeDiscount:
return "auto_renew _soon_image"
case .subscribeVPNProtection:
return "subscribe_protection_image"
case .subscribeAllDevices:
return "subscribe_all-devices_image"
}
}

Expand All @@ -41,6 +50,12 @@ public enum VPNChurnPromoType {
return Strings.VPN.updateBillingSoonExpirePopOverTitle
case .updateBillingExpired:
return Strings.VPN.updateBillingExpiredPopOverTitle
case .subscribeDiscount:
return Strings.VPN.subscribeVPNDiscountPopOverTitle
case .subscribeVPNProtection:
return Strings.VPN.subscribeVPNProtectionPopOverTitle
case .subscribeAllDevices:
return Strings.VPN.subscribeVPNAllDevicesPopOverTitle
}
}

Expand All @@ -52,6 +67,10 @@ public enum VPNChurnPromoType {
return Strings.VPN.updateBillingSoonExpirePopOverDescription
case .updateBillingExpired:
return Strings.VPN.updateBillingExpiredPopOverDescription
case .subscribeVPNProtection:
return Strings.VPN.subscribeVPNProtectionPopOverDescription
case .subscribeAllDevices:
return Strings.VPN.subscribeVPNAllDevicesPopOverDescription
default:
return nil
}
Expand All @@ -61,6 +80,8 @@ public enum VPNChurnPromoType {
switch self {
case .autoRenewSoonExpire:
return Strings.VPN.autoReneSoonExpirePopOverSubDescription
case .subscribeVPNProtection, .subscribeAllDevices:
return Strings.VPN.subscribeVPNPopOverSubDescription
default:
return nil
}
Expand All @@ -72,6 +93,8 @@ public enum VPNChurnPromoType {
return Strings.VPN.autoRenewActionButtonTitle
case .updateBillingSoonExpire, .updateBillingExpired:
return Strings.VPN.updatePaymentActionButtonTitle
case .subscribeDiscount, .subscribeVPNProtection, .subscribeAllDevices:
return Strings.VPN.subscribeVPNActionButtonTitle
}
}
}
Expand Down Expand Up @@ -159,7 +182,7 @@ public struct VPNChurnPromoView: View {
@ViewBuilder
private var detailView: some View {
switch churnPromoType {
case .autoRenewSoonExpire:
case .autoRenewSoonExpire, .subscribeVPNProtection, .subscribeAllDevices:
let description = churnPromoType.description ?? ""
let subDescription = churnPromoType.subDescription ?? ""

Expand All @@ -171,7 +194,7 @@ public struct VPNChurnPromoView: View {
.font(.callout)
.multilineTextAlignment(.center)
}
case .autoRenewDiscount, .autoRenewFreeMonth:
case .autoRenewDiscount, .autoRenewFreeMonth, .subscribeDiscount:
VStack(alignment: .leading, spacing: 8) {
ForEach(descriptionItems, id: \.self) { itemDescription in
HStack(spacing: 8) {
Expand Down

0 comments on commit 171e7eb

Please sign in to comment.