Skip to content

Commit 1a37ec6

Browse files
authored
Authors promo banners (#1120)
* Add model * Add view * Display in home * Add analytics * Open URL * Display in explore
1 parent 24bde72 commit 1a37ec6

File tree

24 files changed

+564
-30
lines changed

24 files changed

+564
-30
lines changed

Stepic.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@
558558
2C313E5526AFE636004ECBD2 /* StepQuizReviewStatusCircleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C313E5426AFE636004ECBD2 /* StepQuizReviewStatusCircleView.swift */; };
559559
2C32E71320FF6C1D008BB909 /* Auth.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2CC351841F6827BE004255B6 /* Auth.storyboard */; };
560560
2C381BEF25505EC90084AD90 /* CourseListFilterBarButtonItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C381BEE25505EC90084AD90 /* CourseListFilterBarButtonItem.swift */; };
561+
2C38D49E27BBCAC6002865B7 /* PromoBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C38D49D27BBCAC6002865B7 /* PromoBanner.swift */; };
562+
2C38D4A027BBD074002865B7 /* PromoBannersService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C38D49F27BBD074002865B7 /* PromoBannersService.swift */; };
563+
2C38D4A227BBD69E002865B7 /* PromoBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C38D4A127BBD69E002865B7 /* PromoBannerView.swift */; };
561564
2C3A035624AE3DCB007D28F7 /* NewProfileStreakNotificationsSwitchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C3A035524AE3DCB007D28F7 /* NewProfileStreakNotificationsSwitchView.swift */; };
562565
2C3A035924AE3E1C007D28F7 /* NewProfileStreakNotificationsTimeSelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C3A035824AE3E1C007D28F7 /* NewProfileStreakNotificationsTimeSelectionView.swift */; };
563566
2C3A052025B763370007FBCA /* WidgetURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C3A051F25B763370007FBCA /* WidgetURL.swift */; };
@@ -2575,6 +2578,9 @@
25752578
2C35C4D41F4DA471002F3BF4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = en; path = LeaderboardNames/en.lproj/nouns_m.plist; sourceTree = "<group>"; };
25762579
2C36E4772501F28E00D63C41 /* Model_user_remove_level_v65.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model_user_remove_level_v65.xcdatamodel; sourceTree = "<group>"; };
25772580
2C381BEE25505EC90084AD90 /* CourseListFilterBarButtonItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseListFilterBarButtonItem.swift; sourceTree = "<group>"; };
2581+
2C38D49D27BBCAC6002865B7 /* PromoBanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromoBanner.swift; sourceTree = "<group>"; };
2582+
2C38D49F27BBD074002865B7 /* PromoBannersService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromoBannersService.swift; sourceTree = "<group>"; };
2583+
2C38D4A127BBD69E002865B7 /* PromoBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromoBannerView.swift; sourceTree = "<group>"; };
25782584
2C3A035524AE3DCB007D28F7 /* NewProfileStreakNotificationsSwitchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewProfileStreakNotificationsSwitchView.swift; sourceTree = "<group>"; };
25792585
2C3A035824AE3E1C007D28F7 /* NewProfileStreakNotificationsTimeSelectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewProfileStreakNotificationsTimeSelectionView.swift; sourceTree = "<group>"; };
25802586
2C3A051F25B763370007FBCA /* WidgetURL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetURL.swift; sourceTree = "<group>"; };
@@ -5397,6 +5403,7 @@
53975403
2CD80A7D269C47670047AE3C /* PaginationState.swift */,
53985404
2CD1D9EB272AA8D80031C78E /* PaymentStore.swift */,
53995405
2CEDC660260898F700B0B018 /* PlatformType.swift */,
5406+
2C38D49D27BBCAC6002865B7 /* PromoBanner.swift */,
54005407
2C5D340725C98A6800372C61 /* PromoCode.swift */,
54015408
2C20778322BBA54800D44DC0 /* QuizStatus.swift */,
54025409
2C619A7E24D0004B007D3529 /* SocialProfileProvider.swift */,
@@ -9061,6 +9068,7 @@
90619068
62E98CA36176671DDF744499 /* PaddingLabel.swift */,
90629069
2C7F641B23B0F5B7006C7648 /* PlayNextCircleControlView.swift */,
90639070
62E984651165CED551545B5C /* ProgressCircleImage.swift */,
9071+
2C38D4A127BBD69E002865B7 /* PromoBannerView.swift */,
90649072
2CB2740322C515050078CA2F /* QuizElementView.swift */,
90659073
62E988152D37F6F6884F2977 /* ScrollableStackView.swift */,
90669074
62E98315DDA05307C326E27C /* SeparatorView.swift */,
@@ -9647,6 +9655,7 @@
96479655
62E98E01F05F1205F284595F /* NetworkReachabilityService.swift */,
96489656
2CDAD309229EC81A00AA9EF5 /* PersistenceQueuesService.swift */,
96499657
2C911B9925C037EB0076DC31 /* PersonalOffersService.swift */,
9658+
2C38D49F27BBD074002865B7 /* PromoBannersService.swift */,
96509659
2CDBCCCE23EB777E005D2370 /* SubmissionURLProvider.swift */,
96519660
62E98FBA6AB1C2BD6EA95634 /* UnitNavigationService.swift */,
96529661
62E98EBA0AF48AD90775FF7E /* UserAccountService.swift */,
@@ -11531,6 +11540,7 @@
1153111540
2CB62BDB2019ECB800B5E336 /* OnboardingCardStepViewController.swift in Sources */,
1153211541
08E7CA1020DAF6E0004F8563 /* AnalyticsUserProperties.swift in Sources */,
1153311542
2C7F41672694938700BD5C48 /* CourseInfoTabReviewsSummaryDistributionCountItemView.swift in Sources */,
11543+
2C38D4A227BBD69E002865B7 /* PromoBannerView.swift in Sources */,
1153411544
2C1AC31E255B476A00E6ECA9 /* CatalogBlocksRepository.swift in Sources */,
1153511545
2C2972052147F5FD001502BD /* CourseTag.swift in Sources */,
1153611546
08EF9A081C91D0F800433E4A /* StepikVideoPlayerViewController.swift in Sources */,
@@ -12310,6 +12320,7 @@
1231012320
62E9804624D413C3F8D71AC7 /* CodeDetailsContentView.swift in Sources */,
1231112321
2C87A7A82446646600933CA4 /* UserActivityEntity.swift in Sources */,
1231212322
62E98E54D4E57B4371493032 /* CodeDetailsLimitItemView.swift in Sources */,
12323+
2C38D4A027BBD074002865B7 /* PromoBannersService.swift in Sources */,
1231312324
62E98C379F06E77CC850DE57 /* CodeDetailsSampleItemView.swift in Sources */,
1231412325
62E988B311FB626588A8615D /* CodeDetailsView.swift in Sources */,
1231512326
62E9819CB6D1AAFEECBF7732 /* CodeEditorView.swift in Sources */,
@@ -12757,6 +12768,7 @@
1275712768
733EA9B5B70C811D7A144DF3 /* CourseRevenueTabMonthlyInputProtocol.swift in Sources */,
1275812769
EF3252195A0C7A3F15319D12 /* CourseRevenueTabMonthlyOutputProtocol.swift in Sources */,
1275912770
F8189D6BC4B0A57D076B052A /* StepQuizReviewAssembly.swift in Sources */,
12771+
2C38D49E27BBCAC6002865B7 /* PromoBanner.swift in Sources */,
1276012772
EE315359D4CBD905081C5F10 /* StepQuizReviewDataFlow.swift in Sources */,
1276112773
2C6277C3270C905200FDAFD9 /* SiriShortcutsStorageManager.swift in Sources */,
1276212774
B7A7B95C8D6C1A2A54487E5B /* StepQuizReviewInteractor.swift in Sources */,
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "promo-banner-illustration-bicycle-green.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true
14+
}
15+
}
27.9 KB
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "promo-banner-illustration-bicycle-violet.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true
14+
}
15+
}
27.9 KB
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "promo-banner-illustration-work.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true
14+
}
15+
}
22.5 KB
Binary file not shown.

Stepic/Legacy/Analytics/Events/AnalyticsEvents.swift

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,38 @@ extension AnalyticsEvent {
108108
static let profileOpenSettingsTapped = AnalyticsEvent(name: "main_choice_settings")
109109
static let profilePinsMapInteracted = AnalyticsEvent(name: "pins_map_interaction")
110110

111+
// MARK: - Promo Banners -
112+
113+
static func promoBannerSeen(_ promoBanner: PromoBanner) -> AnalyticsEvent {
114+
AnalyticsEvent(
115+
name: "Promo banner seen",
116+
parameters: [
117+
"type": promoBanner.type,
118+
"lang": promoBanner.lang,
119+
"title": promoBanner.title,
120+
"description": promoBanner.description,
121+
"url": promoBanner.url,
122+
"screen": promoBanner.screen,
123+
"position": promoBanner.position
124+
]
125+
)
126+
}
127+
128+
static func promoBannerClicked(_ promoBanner: PromoBanner) -> AnalyticsEvent {
129+
AnalyticsEvent(
130+
name: "Promo banner clicked",
131+
parameters: [
132+
"type": promoBanner.type,
133+
"lang": promoBanner.lang,
134+
"title": promoBanner.title,
135+
"description": promoBanner.description,
136+
"url": promoBanner.url,
137+
"screen": promoBanner.screen,
138+
"position": promoBanner.position
139+
]
140+
)
141+
}
142+
111143
// MARK: - Step -
112144

113145
static let generateNewAttemptTapped = AnalyticsEvent(name: "clicked_generate_new_attempt")

Stepic/Legacy/Model/RemoteConfig/RemoteConfig.swift

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ The price includes commission from App Store and VAT. By paying for access to th
126126
self.getNSStringValueFromDelegateOrRemoteConfigForKey(.purchaseFlowPromoCodeEnabled)?.boolValue ?? false
127127
}
128128

129+
var promoBannersStringValue: String? {
130+
self.getStringValueFromDelegateOrRemoteConfigForKey(.promoBanners)
131+
}
132+
129133
init(delegate: RemoteConfigDelegate? = nil) {
130134
self.delegate = delegate
131135

@@ -241,31 +245,9 @@ The price includes commission from App Store and VAT. By paying for access to th
241245
case purchaseFlowDisclaimerRussian = "purchase_flow_ios_disclaimer_ru"
242246
case purchaseFlowDisclaimerEnglish = "purchase_flow_ios_disclaimer_en"
243247
case purchaseFlowPromoCodeEnabled = "purchase_flow_ios_promocode_enabled"
248+
case promoBanners = "promo_banners_ios"
244249

245-
var valueDataType: ValueDataType {
246-
switch self {
247-
case .showStreaksNotificationTrigger:
248-
return .string
249-
case .adaptiveBackendUrl:
250-
return .string
251-
case .supportedInAdaptiveModeCourses:
252-
return .string
253-
case .arQuickLookAvailable:
254-
return .string
255-
case .searchResultsQueryParams:
256-
return .string
257-
case .isCoursePricesEnabled:
258-
return .string
259-
case .isCourseRevenueAvailable:
260-
return .string
261-
case .purchaseFlow:
262-
return .string
263-
case .purchaseFlowDisclaimerRussian, .purchaseFlowDisclaimerEnglish:
264-
return .string
265-
case .purchaseFlowPromoCodeEnabled:
266-
return .string
267-
}
268-
}
250+
var valueDataType: ValueDataType { .string }
269251

270252
fileprivate var analyticsUserPropertyKey: String {
271253
"\(RemoteConfig.analyticsUserPropertyKeyPrefix)\(self.rawValue)"

0 commit comments

Comments
 (0)