Skip to content

Commit

Permalink
Add in app update notification.
Browse files Browse the repository at this point in the history
Update version to 0.9.0
  • Loading branch information
thecodeflayer committed Jul 1, 2020
1 parent 1e96e3e commit 49eebdc
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ I have not fully vetted the logic for all locations. I am looking for help in th

## Installation
In order to install on Android you will have to "side-load" the APK from Github. On most modern Android platforms you can follow these steps:
1. Navigate to the latest release page on the Android device you want to install the app on. Current release is [0.8.12](https://github.com/thecodeflayer/alttp-tracker/releases/tag/0.8.12)
1. Navigate to the latest release page on the Android device you want to install the app on. Current release is [0.9.0](https://github.com/thecodeflayer/alttp-tracker/releases/tag/0.9.0)
2. Under the Assets section, click on the APK file listed on the release page.
3. You will typically receive a warning about APK files harming your device. You will need to confirm download.
4. Once downloaded, click on the downloaded APK file.
Expand Down
4 changes: 2 additions & 2 deletions app/App_Resources/Android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__"
android:versionCode="10012"
android:versionName="0.8.12">
android:versionCode="10013"
android:versionName="0.9.0">

<supports-screens
android:smallScreens="true"
Expand Down
28 changes: 26 additions & 2 deletions app/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Label text="Track item collection and dungeon progress as well as find locations using the maps." class="welcome" textWrap="true" fontSize="20" textAlignment="center"/>
<Label text="More features will be coming as I have time including other modes and glitches." class="welcome" textWrap="true" fontSize="20" textAlignment="center"/>
<Label text="Special thanks to the randomizer community. Visit them!" class="welcome" textWrap="true" fontSize="20" textAlignment="center"/>
<Button :visibility="this.showUpgradeBtn?'visible':'collapsed'" class="btn" @tap="clickUpgrade" backgroundColor="#8b0000">New Version! {{this.upgradeVersion}}</Button>
<Button class="btn" @tap="clickRandomizer">ALTTP Randomizer</Button>
<Button class="btn" @tap="clickReddit">ALTTPR on Reddit</Button>
<Button class="btn" @tap="clickDiscord">ALTTPR Discord</Button>
Expand All @@ -17,11 +18,34 @@

<script>
import {openUrl} from 'tns-core-modules/utils/utils';
export default {
computed: {
import * as convert from 'xml-js';
export default {
data: function() {
return {
showUpgradeBtn: false,
upgradeLink: '',
upgradeVersion: '',
appVersion: this.$modelManager.appVersion
}
},
mounted() {
fetch('https://github.com/thecodeflayer/alttp-tracker/releases.atom')
.then((response) => response.text())
.then((xml) => {
const res = JSON.parse(convert.xml2json(xml, {compact: true, spaces: 2}));
this.upgradeVersion = res.feed.entry[0].title._text;
this.upgradeLink = res.feed.entry[0].link._attributes.href;
this.showUpgradeBtn = (this.upgradeVersion !== this.appVersion);
console.log(this.appVersion, this.upgradeVersion, this.upgradeLink, this.showUpgradeBtn);
}).catch((err) => {
console.log(err);
});
},
methods: {
clickUpgrade() {
openUrl(this.upgradeLink);
},
clickRandomizer() {
openUrl('https://alttpr.com/');
},
Expand Down
1 change: 1 addition & 0 deletions app/components/ModelManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class ModelManager {
items = {};
dungeons = {};
map = {};
appVersion = '0.9.0'
itemsVersion = '0.0.1';
dungeonsVersion = '0.0.2';
mapVersion = '0.0.1';
Expand Down
8 changes: 5 additions & 3 deletions app/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
<Button row="0" col="0" class="btn" @tap="resetItems">Reset Items</Button>
<Button row="1" col="0" class="btn" @tap="resetDungeons">Reset Dungeons</Button>
<Button row="2" col="0" class="btn" @tap="resetMap">Reset Map</Button>
<Label row="3" col="0" class="lbl" horizontalAlignment="center" verticalAlignment="center" text="Version: 0.8.12"/>
<Label row="3" col="0" class="lbl" horizontalAlignment="center" verticalAlignment="center" :text="'Version: '+appVersion"/>
</GridLayout>
</Page>
</template>

<script>
export default {
computed: {
data: function() {
return {
appVersion: this.$modelManager.appVersion
}
},
methods: {
resetItems() {
Expand Down
11 changes: 9 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"dependencies": {
"@nativescript/theme": "~2.3.0",
"nativescript-vue": "~2.4.0",
"tns-core-modules": "~6.5.0"
"tns-core-modules": "~6.5.0",
"xml-js": "^1.6.11"
},
"devDependencies": {
"@babel/core": "~7.1.0",
Expand Down

0 comments on commit 49eebdc

Please sign in to comment.