This plugin will let ShiVa3D developers easily access the app's ID and the app's version number on mobile devices. The "AppID" is the package name on Android or the bundle identifier on iOS.
It is most often best practice to keep an application or game inside one single ShiVa project even if there are several versions of it spread over several platforms and app stores. Consider these options: Debug/Release, Free / Paid, Android/Amazon/Samsung/iOS, etc.
One may decide to change a global variable manually specifying the app its own identity every time before exporting an STK, but this step is repetitive and error prone. Giving each version its own "AppID" inside the Authoring Tool and using this plugin is a convenient solution to this: right after launch, developers can access the "AppID" of the launched app and store it as a member or environment variable for the rest of the app's lifecycle and use this info as a condition to enable or disable certain features or levels, etc.
Even including the platform name in the app ID makes sense as some Android flavors are not quite easy to differentiate purely from script:
Accessing a build's version number among other uses can be used to fill the app's version number automatically in the about/credits screen, or determine if the app has just been updated if the version number has been stored to an environment variable before. Also, if the app's version number is checked against the current version value stored on your server, you can notify the user to update the app.
sAppID = getAppInfo.getAppID ( )
Call this function to get the app's bundle identifier (iOS) or Package name (Android).
An empty string is returned on Windows. The resulting string is usually in this format:
sAppVersion = getAppInfo.getAppVersion ( )
Call this function to get the application's version number.
The resulting string is usually in this format: "1.3.2".
- No extra steps are required in XCode or Eclipse, applications can be built directly from UAT with this plugin.
- The STE archive was exported from ShiVa Advanced 126.96.36.199