Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
a94bc89a
Commit
a94bc89a
authored
Sep 08, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-155: Subscriptions control via config - missing parts.
parent
280006fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
1Weather/AppDelegate.swift
+4
-0
1Weather/Network/Configuration/ConfigManager.swift
+4
-3
No files found.
1Weather/AppDelegate.swift
View file @
a94bc89a
...
@@ -221,6 +221,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
...
@@ -221,6 +221,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
break
// config only
break
// config only
case
.
shortsLastNudge
:
case
.
shortsLastNudge
:
break
// config only
break
// config only
case
.
subscription
:
break
// configOnly
case
.
subscriptionForPro
:
availabilityCheckers
[
feature
]
=
premium
}
}
}
}
...
...
1Weather/Network/Configuration/ConfigManager.swift
View file @
a94bc89a
...
@@ -48,7 +48,7 @@ public class ConfigManager {
...
@@ -48,7 +48,7 @@ public class ConfigManager {
.
attPrompt
:
false
,
.
attPrompt
:
false
,
.
shortsLastNudge
:
false
,
.
shortsLastNudge
:
false
,
.
onboarding
:
false
.
onboarding
:
false
]
]
,
subscriptionsConfig
:
SubscriptionsListConfig
()
)
)
public
func
updateConfig
()
{
public
func
updateConfig
()
{
...
@@ -114,6 +114,7 @@ public class ConfigManager {
...
@@ -114,6 +114,7 @@ public class ConfigManager {
var
popularCities
:
[
GeoNamesPlace
]?
=
nil
var
popularCities
:
[
GeoNamesPlace
]?
=
nil
do
{
do
{
let
decoder
=
JSONDecoder
()
let
popularCitiesData
=
remoteConfig
.
configValue
(
forKey
:
ConfigManager
.
popularCitiesConfigKey
)
.
dataValue
let
popularCitiesData
=
remoteConfig
.
configValue
(
forKey
:
ConfigManager
.
popularCitiesConfigKey
)
.
dataValue
popularCities
=
try
decoder
.
decode
([
GeoNamesPlace
]
.
self
,
from
:
popularCitiesData
)
popularCities
=
try
decoder
.
decode
([
GeoNamesPlace
]
.
self
,
from
:
popularCitiesData
)
}
}
...
@@ -160,7 +161,7 @@ public class ConfigManager {
...
@@ -160,7 +161,7 @@ public class ConfigManager {
shortsLeftBelowCountKey
:
shortsLeftBelowCount
,
shortsLeftBelowCountKey
:
shortsLeftBelowCount
,
shortsSwipeUpNudgeCountKey
:
shortsSwipeNudgeCount
,
shortsSwipeUpNudgeCountKey
:
shortsSwipeNudgeCount
,
explicitFeatureAvailability
:
featureAvailability
,
explicitFeatureAvailability
:
featureAvailability
,
subscriptionConfig
:
subscriptionsConfig
subscription
s
Config
:
subscriptionsConfig
)
)
self
.
notifyAboutConfigUpdate
()
self
.
notifyAboutConfigUpdate
()
DispatchQueue
.
global
()
.
async
{
DispatchQueue
.
global
()
.
async
{
...
@@ -194,7 +195,7 @@ fileprivate extension AppFeature {
...
@@ -194,7 +195,7 @@ fileprivate extension AppFeature {
return
"shorts_swipe_down_nudge_enabled"
return
"shorts_swipe_down_nudge_enabled"
case
.
onboarding
:
case
.
onboarding
:
return
"ios_show_onboarding"
return
"ios_show_onboarding"
case
.
ads
,
.
airQualityIndex
,
.
minutelyForecast
,
.
shorts
,
case
.
subscription
,
.
subscriptionForPro
:
case
.
ads
,
.
airQualityIndex
,
.
minutelyForecast
,
.
shorts
,
.
subscription
,
.
subscriptionForPro
:
return
nil
return
nil
// don't use 'default', so that we didn't add new features here in the future.
// don't use 'default', so that we didn't add new features here in the future.
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment