-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New version available support (#2018)
* Add app update check when the app starts * Add app update check when the app starts * Add translation, update podfile lock * Move app initiazlize check to after the text resources are loaded... * Update translations according to review
- Loading branch information
Showing
14 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
IsraelHiking.Web/src/application/services/application-update.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Injectable } from "@angular/core"; | ||
import { AppUpdate, AppUpdateAvailability } from '@capawesome/capacitor-app-update'; | ||
|
||
import { RunningContextService } from "./running-context.service"; | ||
import { ToastService } from "./toast.service"; | ||
import { ResourcesService } from "./resources.service"; | ||
|
||
@Injectable() | ||
export class ApplicationUpdateService { | ||
constructor(private readonly resourcesService: ResourcesService, | ||
private readonly runningContextSerive: RunningContextService, | ||
private readonly toastService: ToastService) {} | ||
|
||
public async initialize() { | ||
if (!this.runningContextSerive.isCapacitor) { | ||
return; | ||
} | ||
const result = await AppUpdate.getAppUpdateInfo(); | ||
if (result.updateAvailability !== AppUpdateAvailability.UPDATE_AVAILABLE) { | ||
return; | ||
} | ||
this.toastService.confirm({ | ||
type: "YesNo", | ||
message: this.resourcesService.newVersionAvailable, | ||
confirmAction: () => { | ||
AppUpdate.openAppStore(); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters