Skip to content

Commit e677b2b

Browse files
authored
v1.6.5 (#272)
* fix - discord authentication (#199) * Flyout menu - reduce number of taps to sign in * App Shell - Make sure we fetch user data first then bind that data * Flyout - Fix Logout button * Arch - fetching data | setup a singleton to handle fetching structure and bind it to App Shell * Shell - Manage logout within the new mechanism * cleanup - Pages/views * Code base - Org | Organise the weak reference messages classes * News Page -| Setup singleton * Articlepage cleanup * About Page -| set as a singleton * Feeds page -| call as a singleton * Bookmarks - as for all give the singleton treatment * App Shell - remove OpenAuth reference * Android native - BakcPress | remove nullable reference types * fix: Custom feed not loading after navigating from an article (#202) * Fix - Feeds VM | make sure to manage `IsBusy` properly inside `UpdateFeeds()` * cleanup - Feed VM | Forgot to remove the previous setter of `IsBusy` * IOS properties - change Debug linker behaviour (#204) * BETA - Fix: crash sometimes experience on Launch (#205) * MCT - Regester TouchBehavior as a singleton * App.cs - Remove start DB on resume * Ressources - font references | fix the SemiBold reference (#206) * SQLite - update initialisation (#207) * fix: sqlite lockcrash (#208) * SQLite - update initialisation * SqLite - make sure we close the connection after we create the tables * Add sentry breadcrumbs to db creation process (#209) * SQLite - update initialisation * SqLite - make sure we close the connection after we create the tables * App - CreateWindow | add sentry breadcrumbs * imp: optimisation of local storage (#211) * SQLite - update initialisation * SqLite - make sure we close the connection after we create the tables * App - CreateWindow | add sentry breadcrumbs * Local Storage - SQLite | Create a class to genera DB actions * Local storage - general database | fix typo * Local storage - general sqlite DB | Implement the service accross the board * Feed - fix feed search * MainProg - DI | improve org of db singleton registration * Local storage - backup | create a service * fuck me sideways.... * Article Preview - share button | be more specific on the source (#213) * Fetcher - Sources | Utilise a static reference as Sources, as we only really set it once but need it all the time everywhere (#214) * Fix: bookmark status (#216) * Main feed - bookmark | fix the issue of the bookmark status not showing * Local storage - get bookmark | make sure that bookmarks are marked as IsSaved automatically * Local storage - main db | remove unecessary listing of artilces * Bookmark - db | Make sure the status is correctly set * feeds - view model | remove unused references (#217) * Fix: feed bookmark issue (#218) * article - bookmark | make sure to return the rescently added first * Fetcher - bookmarks | improve performance by caching all the bookmarks (as much as possible * Bookmark - caching | loas the bookmarks first thing * Fix: bookmark status not updating on main feed (#219) * Main feed - bookmark status | change the way we reload the article when receiving the bookmark message * Article Model - Change bookmark update * Hotfix: on start exception (#220) * App | Remove StartDb() * Change the way we update Sources * Fetcher.Sources | prevent nullable excepttions * fix: Fetcher - UpdateBackupSources | improve Error handling (#221) * App | Remove StartDb() * Change the way we update Sources * Fetcher.Sources | prevent nullable excepttions * Fetcher - UpdateBackupSources | improve Error handling * cleanup: stuff I forgot (#224) * xaml stuff * remove unused style declaration * Main Feed - Refresh DB | Make the try catch actually useful * Feat: notification setup (#225) * Add google services stuff to git ignore * Include google services files * deps | setup thomasgalliker's `Plugin.FirebasePushNotifications` * Update push notification setup * Apple Manifset - enable remote background thinggy * CI | use environment variable for package id * display packagename * CI/CD - iOS | install GoogleService-Info * CD - android | add secrets * d * CD - android | install google-services.json * prebuild - iOS | fix service tokens * Ci/CD - file google services installations * oops * d * Ci - update all * Notification - android | set the icon * for now let's just `hardcode` packagename (#226) * fix: android pre-build - fix environment variables (#228) * CD - android pre-build | fix environment variables * update xcode version * fix: pipelines xcode version (#229) * pipelines - dev | upgrade xcode * pipelines - prod | upgrade xcode * fix: notification setup (#230) * Ci - Adnroid | Check google services token * Prebuild - android | set the package name from the worflow * push notification - ios | fix setup * deps | Bump Plugin.FirebasePushNotifications to prerelease * Notiffication setup - Android | improve logging * fix: change the approach of Google Services credentials (#231) * CD - android | get google service token * forgot google_services_json * cd - android | Generate and import Google Services in their respective steps * CD - Android | change the way we generate google services * CD - iOS | generate google services * CI - main workflow | forgot google services PLIST * pre-build - android | remove unnecessary stuff * CI/CD - all | Remove redundant references of google services properties * CD - iOS | fix typo * same * workflow | update prod * s * fix - dev pipeline * dev deploy | remove * feat: notifications implement channels (#232) * Notifications - android | add channels * Notifications - Android | List channels * deps | downgrade `Plugin.FirebasePushNotifications` * workflow - android | set `changesNotSentForReview: true` * feat: notification navigation (#233) * Android - setup | enable `SingleTask` Launch Mode * Article - notification | handle navigation to the article * Notification - OnNotificationOpened | convert `articleId` to string * fix crash on notification nav * Article - notification | handle loading indicator better * Android - notification | improve permission request * Article - Notification | add option to handle action * cd-android.yml | unset changesNotSentForReview * Feat: notifications settings (#235) * Android - Notification | add `PostNotification` permission to the manifest * Notification Request | make it makes sense * Shell | add a totally empty settings page * Setting page | design * Settings page - open notification settings * notif - fix| OnNotificationOpened + OnNotificationAction -> escape null inputs (#238) * Hotfix: crash notification (#239) * notif - fix| OnNotificationOpened + OnNotificationAction -> escape null inputs * Notification - OnNotificationOpened | check `articleId` key exist * Notification - OnNotificationOpened | documentation * I'm a bit of an idiot * feat: deals page (#237) * Shell - Views | create and bind deals page * Styles - Add discount color * Deals page - Display deals * Article page - deals | change discount colour * Article page - deals | change size of the discount mark * SQLite - general DB | store deals * Deal Page | create a badge * General Storage | Complete `UpdateDeals` * Cleanp up | Article comparer * Deal page - Add loading indicator * Deal page -| reorder deals * feat: settings - deals (#242) * Settings - deal | enable/disable deal page * Settings - Deals | enable/disable deals on article page * Settings - vm | create a general method to handle updates * feat: add notif badges (#243) * fix: deals loadstuck (#244) * Deals page - fix | update deal `OnAppearing` * Deals page | order by expiring deals * random cleaup * hotfix: crash on notification opening (#246) * Article page - view Model | prevetn `System.ArgumentNullException` on deals * Article page - ViewModel | handle deals process exceptions * ArticleViewModel - constructor | check `Deals` before treating it * iOS - Tab badge | fix out of range issue (#248) * fix: News Feed doesn't reset when pressing its tab (#251) * AndroidShellRenderer - handler | declare it using genereci overload * Fix - android main feed reset | merge AndroidShellRenderer with TabbarBadgeRenderer * feat: dynamic time update (#253) * Converter - Time Span | reformat and clean up * Main feed - vm | create a method to refresh the timespan of the articles * Main Feed - On Resume | enhance the on resume behaviour * News page - update navigation stuff on resume * news page - view model | * Fetcher - ArticleExist | make sure to check for Bookmarks being null (#256) * fix: ios - UI settings tweaks (#257) * Settings Page - UI | Change title * Settings page - UI | tweak notification settings label * Settings page - view | format code * settings page - UI | improve the toggles * Settings page - UI | improve toggle colours * fix: DealPageSett (#258) * Settings Page - UI | Change title * Settings page - UI | tweak notification settings label * Settings page - view | format code * settings page - UI | improve the toggles * Settings page - UI | improve toggle colours * fix: DealPageSett * feat: display source image (#261) * UI - Article Preview | display the logo of the source if available * UI - Article Page | Add source image or badge as title closes #249 * fix: ios badge thread issue (#264) * ios - tab badge | run that on the main thread * ios - tab badge | UpdateBadge() error handling * fix: no internet connection handler (#265) Resolves #262 * fetcher - error handler | prevent internet connection related error from being reported * fcm - offline | notification setup disable if device offline * Fetcher - HTTP error handler | move the internet connection check at the top * fix: update deals on article navigation (#266) * App Shell - vm | make sure to reload the deals when we call `UpdateDeals()` * App Shell - navigation | update deal on each navigation * feat: deals - display time remaining until deals expire (#268) * Converters - | create a time until converter * Deals - page | display time until it expires * Deals page | improving time until display * TimeUntilConverter - correction * TimeUntilConverter - converters | improve * Deal page - expiration | dynamically change the colour * Converters - time until| correct a big mistake * App -| make sure to refresh the Deals when resuming the app * converters - TimeUntil | remove minutes when it's not relevant Resolves #260 * hotfix: time until converter (#269) * Deal page | ensure the timespan until end is not displayed after 30 days * Deal page - time until | improve colour indication * TimeUntilConverter - fix * feat: notification personalised feed (#271) * Feed - Notification | set up channel * Notification - Feed | NE registration * Notification entity | update * Notification - feed | include authentication when updating or creating a Notification Entity * UI - Edit Feed | notification options * notification - feed | get status * Edit page - UI | make it look a bit more similar to the settings page * Edit feed * App - fetcher | setup feed sub/unsub requests * App - Fetcher | fix sub/unsub feed * feed sub payload fix syntax * Data - Fetcher | Add a method to update the server when creating feed * feeds | allow auto synchronisation of feeds * Feed - edit | allow edit of subscription * Edit - feed | sync edit * Fetcher - feed create | prevent network related errors * misc - * notication - fix | if the update of NE fails add it as a new token * Update App/Models/Http/Responses/SubStatusRes.cs [JsonProperty("enabled")] * Update App/Platforms/Android/Notifications/NotificationChannelGamHub.cs * Edit feed page | fix UI * fix - threading | feeds view model * Main feed | feed creation upload * feeds| Cover offline mode update * Feeds - view model | improve multithreading * Deal - Badge | ensure the badge stays there as long as the deals are not acknowledged (#274)
1 parent 3ba904f commit e677b2b

File tree

17 files changed

+739
-132
lines changed

17 files changed

+739
-132
lines changed

App/App.xaml.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,29 @@ public void RemoveLoadingIndicator()
9292
});
9393
}
9494

95+
/// <summary>
96+
/// Process ran if the app was previously used in offline mode
97+
/// </summary>
98+
private async Task RecoverFromOffline()
99+
{
100+
bool connectivity = Connectivity.NetworkAccess == NetworkAccess.Internet;
101+
if (Preferences.Get(AppConstant.OfflineLastRun, false) &&
102+
connectivity)
103+
{
104+
var feeds = new ObservableCollection<Feed>(await _generalDb.GetFeeds());
105+
List<Task> tasks = new List<Task>();
106+
for (int i = 0; i < feeds.Count; i++)
107+
tasks.Add(DataFetcher.UpdateFeed(feeds[i]));
108+
109+
await Task.WhenAll(tasks);
110+
}
111+
Preferences.Set(AppConstant.OfflineLastRun, !connectivity);
112+
}
113+
95114
protected override void OnStart()
96115
{
97-
// Register the date of the first run
116+
Task.Run(RecoverFromOffline);
117+
// Register the date of the first run
98118
DateFirstRun = Preferences.Get(nameof(DateFirstRun), DateTime.MinValue);
99119
if (DateFirstRun == DateTime.MinValue)
100120
{

App/Core/AppConstant.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ public static class AppConstant
2626
public static string PathDBBackUp =>
2727
Path.Combine(FileSystem.AppDataDirectory, DbBackUpFilename);
2828

29+
// secure storage - keys
30+
public const string NotificationToken = "NOTIFICATION_TOKEN";
31+
2932
// Settings - preferences
3033
public const string DealArticleEnable = "DEAL_ARTICLE_ENABLE";
3134
public const string DealPageEnable = "DEAL_PAGE_ENABLE";
35+
public const string OfflineLastRun = "OFFLINE_LAST";
36+
public const string NewDealCount = "NEW_DEAL_COUNT";
3237
}
3338
}

App/Models/Feed.cs

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11

2+
using Newtonsoft.Json;
23
using SQLite;
34
using System.Collections.ObjectModel;
45
using Color = Microsoft.Maui.Graphics.Color;
56

67
namespace GamHubApp.Models;
78

8-
public class Feed : SelectableModel
9-
{
10-
[PrimaryKey, Column("_id")]
11-
public string Id { get; set; }
12-
public string Title { get; set; }
9+
public class Feed : SelectableModel
10+
{
11+
[PrimaryKey, Column("_id")]
12+
public string Id { get; set; }
13+
[JsonProperty("_id"), Column("mongoID")]
14+
public string MongoID { get; set; }
15+
public string Title { get; set; }
1316

14-
private string _keywords;
15-
public string Keywords
17+
private string _keywords;
18+
[JsonProperty("keyword")]
19+
public string Keywords
20+
{
21+
get { return _keywords; }
22+
set
1623
{
17-
get { return _keywords; }
18-
set
19-
{
20-
_keywords = value;
21-
OnPropertyChanged(nameof(Keywords));
22-
}
24+
_keywords = value;
25+
OnPropertyChanged(nameof(Keywords));
2326
}
24-
public bool IsSaved { get; set; }
25-
[Ignore]
26-
public bool IsLoaded { get; set; }
27-
[Ignore]
28-
public Color ButtonColor { get; set; } = (Color)Application.Current.Resources["LightDark"];
29-
[Ignore]
30-
public ObservableCollection<Article> Articles { get; set; }
31-
3227
}
28+
public bool IsSaved { get; set; }
29+
[Ignore]
30+
public bool IsLoaded { get; set; }
31+
[Ignore]
32+
public Color ButtonColor { get; set; } = (Color)Application.Current.Resources["LightDark"];
33+
[Ignore]
34+
public ObservableCollection<Article> Articles { get; set; }
35+
36+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Newtonsoft.Json;
2+
3+
namespace GamHubApp.Models.Http.Payloads;
4+
5+
public sealed class FeedSubPayload
6+
{
7+
[JsonProperty("token")]
8+
public string Token { get; set; }
9+
10+
[JsonProperty("feed")]
11+
public string Feed { get; set; }
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+

2+
using Newtonsoft.Json;
3+
4+
namespace GamHubApp.Models.Http.Payloads;
5+
6+
public class NotificationEntity
7+
{
8+
[JsonProperty("token")]
9+
public string Token { get; set; }
10+
[JsonProperty("feed")]
11+
public string Feed { get; set; }
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Newtonsoft.Json;
2+
3+
namespace GamHubApp.Models.Http.Responses;
4+
5+
public class FeedResponse
6+
{
7+
[JsonProperty("message")]
8+
public string Message { get; set; }
9+
[JsonProperty("data")]
10+
public Feed Data { get; set; }
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace GamHubApp.Models.Http.Responses;
4+
5+
public class NEupdateResponse
6+
{
7+
[JsonPropertyName("message")]
8+
public string Msg { get; set; }
9+
[JsonPropertyName("success")]
10+
public bool Success { get; set; }
11+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+

2+
using Newtonsoft.Json;
3+
4+
namespace GamHubApp.Models.Http.Responses;
5+
6+
public sealed class SubStatusRes
7+
{
8+
[JsonProperty("message")]
9+
public string msg { get; set; }
10+
[JsonProperty("enabled")]
11+
public bool Enabled { get; set; }
12+
}

App/Platforms/Android/Notifications/NotificationChannelGamHub.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ public static IEnumerable<NotificationChannelRequest> GetAll()
2828
#pragma warning restore CA1416 // Validate platform compatibility
2929
};
3030

31+
yield return new NotificationChannelRequest
32+
{
33+
ChannelId = "feed_subscription",
34+
ChannelName = "Your feeds",
35+
Description = "Notifying you of news articles comming up in your feed",
36+
LockscreenVisibility = NotificationVisibility.Public,
37+
#pragma warning disable CA1416 // Validate platform compatibility
38+
Importance = OperatingSystem.IsAndroidVersionAtLeast(24)? NotificationImportance.High : NotificationImportance.Default,
39+
#pragma warning restore CA1416 // Validate platform compatibility
40+
};
41+
3142
// TODO: add more in the future
3243
}
3344
}

App/Resources/Styles/Colors.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<Color x:Key="Dark" >#191414</Color>
1616
<Color x:Key="DarkSecondary" >#4A4A4A</Color>
1717
<Color x:Key="LightDark" >#404348</Color>
18+
<Color x:Key="VeryLightDark" >#D8D9DA</Color>
1819
<Color x:Key="Light" >#8EDCA9</Color>
1920
<Color x:Key="FontColor" >#ecebeb</Color>
2021
<Color x:Key="BgBannerColor" >#262626</Color>

0 commit comments

Comments
 (0)