trying out online update notifications

This commit is contained in:
Jaap Marsman 2022-08-08 16:53:39 +08:00
parent 8015608bea
commit b9a82025e1
5 changed files with 26 additions and 22 deletions

View File

@ -2,6 +2,6 @@
- As can be seen by inspecting the source code, the app contains no tracking features or advertisement systems of ANY kind. I am not interested in your data. - As can be seen by inspecting the source code, the app contains no tracking features or advertisement systems of ANY kind. I am not interested in your data.
- Any data entered into the app (your name, birthdate, etc) is stored locally on your device. - Any data entered into the app (your name, birthdate, etc) is stored locally on your device.
- The only "phone home" function that the app will do (once programmed) is to check for app updates online. If you're not online, the check fails. Simple as that. - The only internet connectivity that the app employs is to check for app updates online (by checking the file version_stuff.csv here on GitHub). If you're not online, the check fails, simple as that. The code for this function will only trigger if you press the "Check for Updates" button. It can be inspected in start_menu.gd
Too often "free" apps make you their product. Or are free with a hefty subscription lurking around the corner. I get it, for some people, such apps are their livelihood. For me, it's something I wish to develop and hope other people find useful. There is no monetary gain here. Of course I'm curious to see who uses the app. That's why I offer the option to subscribe to a newsletter, which is different. It's opt-in privacy-by-design stuff. You don't want to sign up? Don't press the button. It's really that simple. :) Too often "free" apps make you their product. Or are free with a hefty subscription lurking around the corner. I get it, for some people, such apps are their livelihood. For me, it's something I wish to develop and hope other people find useful. There is no monetary gain here. Of course I'm curious to see who uses the app. That's why I offer the option to subscribe to a newsletter, which is different. It's opt-in privacy-by-design stuff. You don't want to sign up? Don't press the button. It's really that simple. :)

View File

@ -8,10 +8,11 @@ extends Node
# download button if there is. # download button if there is.
var release_version = 1 var release_version = 1
var web_release_version = 0
func _ready(): func _ready():
pass pass
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta): #func _process(delta):
# pass # pass

View File

@ -4,11 +4,19 @@ extends Node2D
onready var user_info = get_node("/root/UserValues") onready var user_info = get_node("/root/UserValues")
onready var program_info = get_node("/root/ProgramValues") onready var program_info = get_node("/root/ProgramValues")
# Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
pass $HTTPRequest.connect("request_completed", self, "_on_request_completed")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta): func _process(_delta):
$welcome_title.text = "Good morning " + user_info.user_first_name + "!" $welcome_title.text = "Good morning " + user_info.user_first_name + "!"
# pass
func _on_button_update_check_pressed():
$HTTPRequest.request("https://raw.githubusercontent.com/hobbesjaap/wellbeingapp/main/version_stuff.csv")
#func _on_HTTPRequest_request_completed(result, response_code, headers, body):
func _on_request_completed(result, response_code, headers, body):
var json = JSON.parse(body.get_string_from_utf8())
program_info.web_release_version = json.result

View File

@ -56,6 +56,15 @@ margin_bottom = 56.0
text = "Name" text = "Name"
script = ExtResource( 5 ) script = ExtResource( 5 )
[node name="HTTPRequest" type="HTTPRequest" parent="start_menu"]
[node name="button_update_check" type="Button" parent="start_menu"]
margin_left = 658.0
margin_top = 354.0
margin_right = 880.0
margin_bottom = 391.0
text = "Check for Updates"
[node name="user_details" type="Node2D" parent="."] [node name="user_details" type="Node2D" parent="."]
visible = false visible = false
@ -84,4 +93,6 @@ text = "Day"
[connection signal="pressed" from="start_menu/button_open_github" to="start_menu/button_open_github" method="_on_button_open_github_pressed"] [connection signal="pressed" from="start_menu/button_open_github" to="start_menu/button_open_github" method="_on_button_open_github_pressed"]
[connection signal="pressed" from="start_menu/button_email_feedback" to="start_menu/button_email_feedback" method="_on_button_email_feedback_pressed"] [connection signal="pressed" from="start_menu/button_email_feedback" to="start_menu/button_email_feedback" method="_on_button_email_feedback_pressed"]
[connection signal="pressed" from="start_menu/button_name" to="start_menu/button_name" method="_on_button_name_pressed"] [connection signal="pressed" from="start_menu/button_name" to="start_menu/button_name" method="_on_button_name_pressed"]
[connection signal="request_completed" from="start_menu/HTTPRequest" to="start_menu" method="_on_HTTPRequest_request_completed"]
[connection signal="pressed" from="start_menu/button_update_check" to="start_menu" method="_on_button_update_check_pressed"]
[connection signal="pressed" from="user_details/button_user_save" to="user_details/button_user_save" method="_on_button_user_save_pressed"] [connection signal="pressed" from="user_details/button_user_save" to="user_details/button_user_save" method="_on_button_user_save_pressed"]

View File

@ -1,16 +0,0 @@
extends CanvasLayer
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass