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
cdd773d7
Commit
cdd773d7
authored
Oct 14, 2021
by
Dmitry Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IOS-259]: Fixed incorrect events order for widgets
parent
c464fb65
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
14 deletions
+13
-14
1Weather.xcodeproj/xcshareddata/xcschemes/OneWeatherWidgetExtension.xcscheme
+2
-2
1Weather/Coordinators/TodayCoordinator.swift
+1
-1
1Weather/Network/PushNotificationsManager.swift
+0
-1
OneWeatherCore/OneWeatherCore/Managers/WidgetManager.swift
+3
-3
OneWeatherWidget/Data/WeatherProvider.swift
+7
-7
No files found.
1Weather.xcodeproj/xcshareddata/xcschemes/OneWeatherWidgetExtension.xcscheme
View file @
cdd773d7
...
...
@@ -91,11 +91,11 @@
<EnvironmentVariable
key =
"_XCWidgetDefaultView"
value =
"timeline"
isEnabled =
"
NO
"
>
isEnabled =
"
YES
"
>
</EnvironmentVariable>
<EnvironmentVariable
key =
"_XCWidgetFamily"
value =
"
medium
"
value =
"
small
"
isEnabled =
"YES"
>
</EnvironmentVariable>
</EnvironmentVariables>
...
...
1Weather/Coordinators/TodayCoordinator.swift
View file @
cdd773d7
...
...
@@ -15,7 +15,7 @@ protocol TodayCoordinatorDelegate: AnyObject {
class
TodayCoordinator
:
Coordinator
{
// MARK: - Private
private
let
navigationController
=
ColoredNavigationController
(
nibName
:
nil
,
bundle
:
nil
)
private
var
tabBarController
:
UITabBarController
?
private
var
tabBarController
:
UITabBarController
?
var
todayViewController
:
TodayViewController
?
// MARK: - Public
...
...
1Weather/Network/PushNotificationsManager.swift
View file @
cdd773d7
...
...
@@ -14,7 +14,6 @@ import OneWeatherAnalytics
public
class
PushNotificationsManager
:
NSObject
,
PushNotificationsManagerProtocol
{
// MARK: - Private
private
let
log
=
Logger
(
componentName
:
"PushNotificationsManager"
)
private
let
configManager
:
ConfigManager
...
...
OneWeatherCore/OneWeatherCore/Managers/WidgetManager.swift
View file @
cdd773d7
...
...
@@ -111,7 +111,7 @@ public class WidgetManager {
private
let
smartTextProvider
=
SmartTextProvider
(
prioritizedSmartTexts
:
SmartTextProvider
.
defaultSmartTexts
)
private
var
widgetOptions
:
WidgetOptions
=
[]
public
func
refreshAnalytics
()
{
public
func
refreshAnalytics
(
completion
:
(()
->
Void
)?
=
nil
)
{
WidgetCenter
.
shared
.
getCurrentConfigurations
{[
weak
self
]
result
in
switch
result
{
case
.
success
(
let
widgetInfo
):
...
...
@@ -119,6 +119,7 @@ public class WidgetManager {
case
.
failure
(
let
error
):
self
?
.
log
.
error
(
error
.
localizedDescription
)
}
completion
?()
}
}
...
...
@@ -156,8 +157,7 @@ public class WidgetManager {
}
}
AppAnalytics
.
shared
.
log
(
event
:
.
ANALYTICS_WIDGET_UPDATED
,
params
:
params
)
AppAnalytics
.
shared
.
log
(
event
:
.
ANALYTICS_WIDGET_UPDATED
,
params
:
params
)
}
}
...
...
OneWeatherWidget/Data/WeatherProvider.swift
View file @
cdd773d7
...
...
@@ -43,6 +43,7 @@ class WeatherProvider: TimelineProvider {
locationSource
.
getUpToDateLocation
{
[
weak
self
]
location
in
guard
let
self
=
self
else
{
return
}
var
needToLogUpdate
=
false
if
let
fetchedLocation
=
location
,
let
coordinates
=
fetchedLocation
.
coordinates
...
...
@@ -55,9 +56,7 @@ class WeatherProvider: TimelineProvider {
let
nextRefresh
=
Calendar
.
current
.
date
(
byAdding
:
.
minute
,
value
:
30
,
to
:
Date
())
!
let
entry
=
WeatherEntry
(
location
:
fetchedLocation
,
date
:
nextRefresh
,
radarMapImage
:
mapImage
)
let
timeline
=
Timeline
(
entries
:
[
entry
],
policy
:
.
atEnd
)
if
!
context
.
isPreview
{
WidgetManager
.
shared
.
logUpdate
(
forLocation
:
location
,
kind
:
self
.
widgetKind
,
family
:
context
.
family
)
}
needToLogUpdate
=
true
completion
(
timeline
)
}
}
...
...
@@ -78,10 +77,11 @@ class WeatherProvider: TimelineProvider {
}
if
!
context
.
isPreview
{
WidgetManager
.
shared
.
refreshAnalytics
()
if
needToLogUpdate
{
WidgetManager
.
shared
.
logUpdate
(
forLocation
:
location
,
kind
:
self
.
widgetKind
,
family
:
context
.
family
)
}
WidgetManager
.
shared
.
refreshAnalytics
(
completion
:
{
if
needToLogUpdate
{
WidgetManager
.
shared
.
logUpdate
(
forLocation
:
location
,
kind
:
self
.
widgetKind
,
family
:
context
.
family
)
}
})
}
}
}
...
...
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