One Time Event

syncmaster13

Member
Licensed User
Longtime User
Hi
If I would like to show a message in my app showing something like : “ New In this version ………” after a user update it.
What is the best way to do it considering it has to show only if the app version is newer and it shows only once?
Thank You
 

grant1842

Active Member
Licensed User
Longtime User
I would imagine the simplest way would to store that information in a simple text file. The first line could have the version. The second could have whether or not the message has been shown. Then each time the app is run, check the version number. If the stored version number is different than the app version then display the message and store that is has been shown.
 
Upvote 0

syncmaster13

Member
Licensed User
Longtime User
Thanks for replay

In mean time I’ve been trying to use “If FirstTime…” and I see one problem with it. After I restart my device and I run my app it act as it is the first time.; so I decide to write this code:
If File.Exists(File.DirInternal, "first_time") Then
Msgbox("Not First time", "Not The First Time !!!")
Else
Msgbox("First Time", “First time")
File.WriteString(File.DirInternal, "first_time", "not a first time")
End If

And it seems to run as intended. Even after restarting device.


Just thought to share my experience
 
Upvote 0

syncmaster13

Member
Licensed User
Longtime User
Thank You for help. This should work now

If File.Exists(File.DirInternal, "first_time") Then ' Not The First Time Install "UPDATE"
Dim versionCode As String
versionCode = File.ReadString(File.DirInternal, "first_time")
If versionCode = 1 Then ' The same version as Project Attributes
'Msgbox("This is the same Version", "!!!")
Else
Msgbox("1" & CRLF & " 2"& CRLF & " 3", "WHAT'S NEW")
File.WriteString(File.DirInternal, "first_time", "1") ' The same version as Project Attributes
End If

Else ' First Time Install
Msgbox("Thank you for your purchase" ,"")
File.WriteString(File.DirInternal, "first_time", "1") ' The same version as Project Attributes
End If
 
Upvote 0
Top