Be a Supporter!

Browse Sections

Newgrounds Wiki: App

Description Used to get and validate information associated with your app, including user sessions.

App.checkSession

Return to Top ^Checks the validity of a session id and returns the results in a session object.

Returns:

session - session

App.endSession

Return to Top ^Ends the current session, if any.

App.getCurrentVersion

Return to Top ^Gets the version number of the app as defined in your "Version Control" settings.

Parameters:

version - string
The version number (in "X.Y.Z" format) of the client-side app. (default = "0.0.0") (optional)

Returns:

client_deprecated - boolean
Notes whether the client-side app is using a lower version number.

current_version - string
The version number of the app as defined in your "Version Control" settings.

App.getHostLicense

Return to Top ^Checks a client-side host domain against domains defined in your "Game Protection" settings.

Parameters:

host - string
The host domain to check (ei, somesite.com). (optional)

Returns:

host_approved - boolean

App.logView

Return to Top ^Increments "Total Views" statistic.

Parameters:

host - string
The domain hosting your app. Examples: "www.somesite.com", "localHost"

App.startSession

Return to Top ^Starts a new session for the application.

Parameters:

force - boolean
If true, will create a new session even if the user already has an existing one.

Note: Any previous session ids will no longer be valid if this is used. (optional)

Returns:

session - session