Skip to content

Commit 65ece70

Browse files
authored
v1.6.53 (#283)
* 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) * Fix: error subscription not found (#275) * view models - edit feed | fix feed notification check * ViewModel - edit feed | compare Notification values * Deals - TimeUntilConverter | fix mishap when timespan is lower than a day (#277) * code base - debug setup | fix issue where the Discord auth wouldn't work (#279) * Deals - TimeUntilConverter| consider time zone (#280) * Data fetcher - Introduce a CheckFeasability() function (#282) * Deals page - cards | increase size of the discount badge (#284) * Feeds - delete | iOS fix crashes (#286) closes #285 * Android - Resources | update the accent colour (#287) * Imp: change inapp store reviews (#288) * Article page - | update store reviews criteria * acticle page - store review | change the threshold * format
1 parent 4caa871 commit 65ece70

File tree

6 files changed

+169
-113
lines changed

6 files changed

+169
-113
lines changed

App/Core/AppConstant.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
namespace GamHubApp.Core
42
{
53
public static class AppConstant
@@ -34,5 +32,6 @@ public static class AppConstant
3432
public const string DealPageEnable = "DEAL_PAGE_ENABLE";
3533
public const string OfflineLastRun = "OFFLINE_LAST";
3634
public const string NewDealCount = "NEW_DEAL_COUNT";
35+
public const string ReviewAsked = "REVIEW_ASKED";
3736
}
3837
}

App/Platforms/Android/Resources/values/colors.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<resources>
33
<color name="colorPrimary">#512BD4</color>
44
<color name="colorPrimaryDark">#233A56</color>
5-
<color name="colorAccent">#2B0B98</color>
5+
<color name="colorAccent">#FF5733</color>
66
<color name="notification_color">#4AC776</color>
77
</resources>

App/Services/Fetcher.cs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public Fetcher(GeneralDataBase generalDataBase, BackUpDataBase backUpDataBase)
5252
/// <returns>last 2 months worth of feed</returns>
5353
public async Task<Collection<Article>> GetMainFeedUpdate()
5454
{
55+
if (!Fetcher.CheckFeasability())
56+
return null;
5557
try
5658
{
5759

@@ -81,6 +83,8 @@ public async Task<Collection<Article>> GetMainFeedUpdate()
8183
/// <exception cref="Exception"></exception>
8284
public async Task<Collection<Source>> GetSources()
8385
{
86+
if (!Fetcher.CheckFeasability())
87+
return null;
8488
return Fetcher.Sources = await WebService.Get<Collection<Source>>(controller: "sources",
8589
action: "getAll",
8690
unSuccessCallback: e => _ = HandleHttpException(e));
@@ -94,6 +98,8 @@ public async Task<Collection<Source>> GetSources()
9498
/// <returns></returns>
9599
public async Task<Collection<Article>> GetFeedArticles(string keywords, string timeUpdate = null, bool needUpdate = false)
96100
{
101+
if (!Fetcher.CheckFeasability())
102+
return new Collection<Article>();
97103
try
98104
{
99105
if (string.IsNullOrEmpty(keywords))
@@ -123,6 +129,8 @@ public async Task<Collection<Article>> GetFeedArticles(string keywords, string t
123129
/// <returns></returns>
124130
public async Task<Session> RefreshDiscordSession(string refreshToken)
125131
{
132+
if (!Fetcher.CheckFeasability())
133+
return null;
126134
try
127135
{
128136
RefreshDiscordPayload payload = new()
@@ -157,6 +165,8 @@ public async Task<Session> RefreshDiscordSession(string refreshToken)
157165
/// <returns>latest articles the date provided</returns>
158166
public async Task<Collection<Article>> GetMainFeedUpdate(string dateUpdate)
159167
{
168+
if (!Fetcher.CheckFeasability())
169+
return new Collection<Article>();
160170
try
161171
{
162172

@@ -184,6 +194,8 @@ public async Task<Collection<Article>> GetMainFeedUpdate(string dateUpdate)
184194
/// <returns>chunk articles the date provided</returns>
185195
public async Task<Collection<Article>> GetFeedChunk(DateTime dateFrom, int length)
186196
{
197+
if (!Fetcher.CheckFeasability())
198+
return null;
187199
try
188200
{
189201
//dateFrom = new DateTime(dateFrom.Year, dateFrom.Month, dateFrom.Day, dateFrom.Hour, dateFrom.Minute, 0);
@@ -214,6 +226,8 @@ public async Task<Collection<Article>> GetFeedChunk(DateTime dateFrom, int lengt
214226
/// <returns>partners</returns>
215227
public async Task<Collection<Partner>> GetPartners()
216228
{
229+
if (!Fetcher.CheckFeasability())
230+
return null;
217231
try
218232
{
219233
return await this.WebService.Get<Collection<Partner>>(controller: "partners",
@@ -237,6 +251,8 @@ public async Task<Collection<Partner>> GetPartners()
237251
/// <returns>all the deals</returns>
238252
public async Task<Collection<Deal>> GetDeals()
239253
{
254+
if (!Fetcher.CheckFeasability())
255+
return null;
240256
try
241257
{
242258
return _deals = await this.WebService.Get<Collection<Deal>>(controller: "deals",
@@ -261,6 +277,8 @@ public async Task<Collection<Deal>> GetDeals()
261277
/// <returns>retrun the article</returns>
262278
public async Task<Article> GetArticle(string articleId)
263279
{
280+
if (!Fetcher.CheckFeasability())
281+
return null;
264282
try
265283
{
266284
return await this.WebService.Get<Article>(controller: "article",
@@ -286,6 +304,8 @@ public async Task<Article> GetArticle(string articleId)
286304
/// <returns>retrun the article</returns>
287305
public async Task RegisterNotificationEntity(string token, Dictionary<string, string> rqHeaders = null )
288306
{
307+
if (!Fetcher.CheckFeasability())
308+
return;
289309
try
290310
{
291311
if (rqHeaders is null)
@@ -330,7 +350,7 @@ public async Task<bool> CheckSubStatus(string feed, string token)
330350
{
331351
try
332352
{
333-
if (Connectivity.NetworkAccess != NetworkAccess.Internet)
353+
if (!Fetcher.CheckFeasability())
334354
return false;
335355

336356
Dictionary<string, string> rqHeaders = new();
@@ -468,6 +488,8 @@ public async Task<Feed> CreateFeed(Feed feed)
468488
/// <param name="feed">ID of the feed concerned by the subscription</param>
469489
public async Task<Feed> UpdateFeed(Feed feed)
470490
{
491+
if (!Fetcher.CheckFeasability())
492+
return null;
471493
try
472494
{
473495
string name = feed.Title;
@@ -517,6 +539,8 @@ public async Task<Feed> UpdateFeed(Feed feed)
517539
/// <returns>retrun the article</returns>
518540
public async Task UnsubscribeToFeed(string feedID, string token)
519541
{
542+
if (!Fetcher.CheckFeasability())
543+
return ;
520544
try
521545
{
522546
Dictionary<string, string> rqHeaders = new();
@@ -561,6 +585,8 @@ await this.WebService.Delete(controller: "monitor",
561585
/// <returns>retrun the article</returns>
562586
public async Task UpdateNotificationEntity(string newToken, string oldToken)
563587
{
588+
if (!Fetcher.CheckFeasability())
589+
return;
564590
try
565591
{
566592
Dictionary<string, string> rqHeaders = new();
@@ -627,6 +653,8 @@ public async Task SaveSession (Session newSession)
627653
/// </summary>
628654
public async Task RestoreSession ()
629655
{
656+
if (!Fetcher.CheckFeasability())
657+
return;
630658
// Save regular data about the session
631659
int exp = Preferences.Get(nameof(Session.ExpiresIn), Int16.MinValue);
632660
string refreshToken = await SecureStorage.GetAsync(nameof(Session.RefreshToken)).ConfigureAwait(false);
@@ -687,6 +715,8 @@ private bool EvaluateCurrentSession()
687715
/// <param name="article">article hooked</param>
688716
public async Task RegisterHook(Article article)
689717
{
718+
if (!Fetcher.CheckFeasability())
719+
return ;
690720
var headers = new Dictionary<string, string>
691721
{
692722
{ "x-api-key", AppConstant.MonitoringKey},
@@ -764,6 +794,16 @@ private async Task HandleHttpException(HttpResponseMessage err)
764794
#endif
765795
}
766796

797+
/// <summary>
798+
/// check feasability of the request
799+
/// </summary>
800+
/// <remarks> This method is static for now be we can change that</remarks>
801+
/// <returns>true == Feasable</returns>
802+
private static bool CheckFeasability()
803+
{
804+
return Connectivity.NetworkAccess == NetworkAccess.Internet;
805+
}
806+
767807
#region Local Actions
768808

769809
/// <summary>

0 commit comments

Comments
 (0)