File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
sdk/Notifo.SDK/NotifoMobilePush Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ internal sealed class TrackSeenCommand : ICommand
20
20
[ Obsolete ]
21
21
public HashSet < Guid > Ids
22
22
{
23
+ // Convert the old IDs to the new dictionary, so that we can read old commands from the disk.
23
24
set => IdsAndUrls = value . ToDictionary ( x => x , x => ( string ? ) null ) ;
24
25
}
25
26
@@ -32,8 +33,10 @@ public async ValueTask ExecuteAsync(
32
33
{
33
34
try
34
35
{
36
+ // The notifo based app might receive notifications even though the API key is not configured.
35
37
if ( ! NotifoIO . Current . IsConfigured )
36
38
{
39
+ // Then we have to fallback to URLs.
37
40
await TrackWithUrlsAsync ( ct ) ;
38
41
}
39
42
else
@@ -53,6 +56,7 @@ private async Task TrackWithUrlsAsync(
53
56
{
54
57
var urls = IdsAndUrls . Values . Where ( x => x != null ) . ToList ( ) ;
55
58
59
+ // If some IDs do not have an URL, we create an error, because this should only happen for old commands.
56
60
if ( urls . Count < IdsAndUrls . Count )
57
61
{
58
62
NotifoIO . Current . RaiseError ( Strings . TrackingURLMissing , null , this ) ;
@@ -63,7 +67,7 @@ private async Task TrackWithUrlsAsync(
63
67
return ;
64
68
}
65
69
66
- var httpClient = NotifoIO . Current . CreateHttpClient ( ) ;
70
+ using var httpClient = NotifoIO . Current . CreateHttpClient ( ) ;
67
71
68
72
foreach ( var url in urls )
69
73
{
You can’t perform that action at this time.
0 commit comments