root / src / app / upgrade / upgrade.component.ts @ 54800558
Historique | Voir | Annoter | Télécharger (1,53 ko)
1 |
import { Component, OnInit } from "@angular/core"; |
---|---|
2 |
import { RadSideDrawer } from "nativescript-ui-sidedrawer"; |
3 |
import * as app from "tns-core-modules/application"; |
4 |
import { isAndroid, isIOS, device, screen } from "tns-core-modules/platform"; |
5 |
import { getString, setString, hasKey, remove, clear } from "tns-core-modules/application-settings"; |
6 |
|
7 |
@Component({ |
8 |
selector: "Upgrade", |
9 |
templateUrl: "./upgrade.component.html" |
10 |
}) |
11 |
export class UpgradeComponent implements OnInit { |
12 |
private changelog: string; |
13 |
private message: string; |
14 |
private upgradeuri: string; |
15 |
public serverJSON: JSON; |
16 |
|
17 |
constructor() { |
18 |
// Use the component constructor to inject providers. |
19 |
this.changelog = ""; |
20 |
this.message = ""; |
21 |
this.upgradeuri = ""; |
22 |
} |
23 |
|
24 |
ngOnInit(): void { |
25 |
// Init your component properties here. |
26 |
this.serverJSON = JSON.parse(getString("serverJSON")); |
27 |
this.changelog = this.serverJSON['APPchangelog']; |
28 |
} |
29 |
|
30 |
onDrawerButtonTap(): void { |
31 |
const sideDrawer = <RadSideDrawer>app.getRootView(); |
32 |
sideDrawer.showDrawer(); |
33 |
} |
34 |
|
35 |
onUpgradeTap(): void { |
36 |
var utilityModule = require("utils/utils"); |
37 |
if (isIOS) { |
38 |
utilityModule.openUrl("itms-apps://itunes.apple.com/fr/app/id1505189000"); |
39 |
} |
40 |
else { |
41 |
utilityModule.openUrl("market://details?id=clicalbum.caprel.fr"); |
42 |
} |
43 |
} |
44 |
|
45 |
onWebsiteTap(): void { |
46 |
var utilityModule = require("utils/utils"); |
47 |
utilityModule.openUrl("https://clicalbum.abuledu.net"); |
48 |
} |
49 |
|
50 |
|
51 |
} |