EULA: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
 
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[File:EULA.png|thumbnail]]
[[File:EULA.png]]


NSB.ShowProgress(''message'')
== Description ==


== Description ==
The EULA property in [[Properties Window|Project Properties]] lets you specify a End User License Agreement when your app starts up. If the user agrees to it, LocalStorage.EULA will be True. If not, it will be False.
 
In your code, you should check this value. If the value is False, you cannot terminate the app, but you can put up a warning message asking the user to restart the app and agree to the EULA before the app can be used. (The reason you cannot terminate the app is that it will break the User Interface Guidelines from the manufacturers. Apple will reject your app. Use the Home button to exit an app.)
 
To enable the EULA, put your EULA text into the 'EULA' property in [[Properties Window|Project Properties]]. The text can be formatted HTML.


NSB.ShowProgress displays ''message'' to the user near the bottom middle of the screen. It can be dismissed or updated at any time by the program. The user can also dismiss it. Use it to provide the user with information during execution without interrupting execution.
[[Category:Language Reference]]


To dismiss an NSB.showProgress message, call it with no arguments.
[[Category:Controls]]


== Example ==
== Example ==
To test if the EULA has been agreed to:
<tabber>
JavaScript=
<syntaxhighlight lang="JavaScript">
if (localStorage[NSB.id & "_EULA"] == false) {
  Alert("Please agree to EULA to unlock all features of this app.");
}
// To change the font size of the text:
window.addEventListener('load', function() {NSB_text.style.fontSize="20px"}, false);
</syntaxhighlight>
|-|
BASIC=
<syntaxhighlight lang="vb.net">
If localStorage[NSB.id & "_EULA"] = False Then
  MsgBox "Please agree to EULA to unlock all features of this app."
End If


<pre>
' No code is needed to display the EULA.  
'This sample shows how to use the NSB.ShowProgress function
' If you would like to reset the EULA so it appears next time the app is run, use this code:
' this function shows you how to reset the EULA setting.
'Set a global counter and call updateMessage every quarter second
Function Button1_onclick()
Dim count=0
   localStorage[NSB.id & "_EULA"] = False
SetInterval(updateMessage,250)
End Function
</syntaxhighlight>
Sub updateMessage()
</tabber>
  count=count+1
  If count<20 Then
    'Display the progress message followed by dots
    NSB.ShowProgress("Loading" & String(count,"."))
  Else
    'Clear the progress message and stop calling updateMessage
    NSB.ShowProgress()
    ClearInterval(updateMessage)
   End If
End Sub
Sub custDone(result)
  Text2.value=result
End Sub
</pre>


== Output ==
== Output ==


<pre>
(see above)
(depends on use. See nsbShowProgress sample)
</pre>


== Related Items ==
== Related Items ==

Latest revision as of 14:33, 24 July 2019

Description

The EULA property in Project Properties lets you specify a End User License Agreement when your app starts up. If the user agrees to it, LocalStorage.EULA will be True. If not, it will be False.

In your code, you should check this value. If the value is False, you cannot terminate the app, but you can put up a warning message asking the user to restart the app and agree to the EULA before the app can be used. (The reason you cannot terminate the app is that it will break the User Interface Guidelines from the manufacturers. Apple will reject your app. Use the Home button to exit an app.)

To enable the EULA, put your EULA text into the 'EULA' property in Project Properties. The text can be formatted HTML.

Example

To test if the EULA has been agreed to:

if (localStorage[NSB.id & "_EULA"] == false) {
  Alert("Please agree to EULA to unlock all features of this app.");
}
// To change the font size of the text:
window.addEventListener('load', function() {NSB_text.style.fontSize="20px"}, false);

If localStorage[NSB.id & "_EULA"] = False Then
  MsgBox "Please agree to EULA to unlock all features of this app."
End If

' No code is needed to display the EULA. 
' If you would like to reset the EULA so it appears next time the app is run, use this code:
' this function shows you how to reset the EULA setting.
Function Button1_onclick()
  localStorage[NSB.id & "_EULA"] = False
End Function

Output

(see above)

Related Items