API Reference
List of functions and variables exposed by the Stagecast object, the entry point to the MDK library.
In case you want to code right away, you can check out the tutorial section and come back here later.
Introduction
The Stagecast
object is library entry point and comes with some getter function that allows to access the Moment context data. The context data is grouped in the general getters section.
You can also get directly to the sub sections:
General Getters
Your HTML-based application will get its running context from the Moment. The moment is derived from a MomentClass which belongs to a specific Event.
getEventId(): string
getEventId(): string
Returns the current event id. The id is a UUIDv4.
getUserId(): string
getUserId(): string
Returns the User identification which most of the times is the email.
getMomentId(): string
getMomentId(): string
Returns the Moment id as a string. The id is a UUIDv4.
getMomentClassId(): string
getMomentClassId(): string
Returns the MomentClass id. The id is a UUIDv4.
isActive(): boolean
isActive(): boolean
Tells whether the Moment is active or not, ie. whether the moment has been stopped by the event organizer from the launchpad. It can be used to render different views, for example:
Often, this is used to display the moment results. An example could be a poll: as long as isActive()
returns true
the user can express a vote. When the moment stops and isActive()
return false
, the application could display the poll results or just the user vote.
getCoordinates(): [lat, long]
getCoordinates(): [lat, long]
This function returns the user coordinates as an array of string where the first entry is the latitude and the second is the longitude. The coordinates can be used to activate some functionality depending on the user's location.
In case the wrapper mobile app, or the wrapper website can't get this values, the default ['0', '0']
is returned.
The bannerInjector
object
bannerInjector
objectinjectAdvertisementBanner(selectors: string[])
injectAdvertisementBanner(selectors: string[])
The function injects the credits
text and the sponsor logos
specified in the Moment Class configuration window in the organizer dashboard.
If your moment doesn't support branding, you will have to specify that in the MANIFEST.json.
Params:
selectors
: list of CSS3 selectors in which the advertisement images will be injected.
Last updated