getRuntimeVersion
Get Runtime Version Number
getRuntimeVersion is a class method of the SUDRT protocol. It returns the exact version string of the current game engine (Runtime) kernel. This version number is the key basis for troubleshooting compatibility issues, confirming patch updates, and performing server-side version alignment.
Method Declaration
objectivec
/**
* Returns the version string of the current Runtime engine.
* @return A version number string, for example @"1.2.30.5" or @"2.0.0-rc1".
*/
+ (NSString *)getRuntimeVersion;Runtime Behavior
- Static version: This method returns a static string determined at SDK compile time, representing the kernel version of the current binary library file.
- Fine-grained identification: Compared with the description provided by
getRuntimeDescription,getRuntimeVersionprovides a numeric version, which is convenient for logic judgments such as "a certain API is only supported from1.5.0onward". - Multi-device sync: Typically used to report to the business backend, to gather statistics on game runtime performance across different engine versions.
Code Example
Display the engine version in the App launch log or the "About" page:
objectivec
// Get the specific version number
NSString *version = [SudRuntimeImpl getRuntimeVersion];
// Business logic example: perform a high-performance initialization only when the version is greater than or equal to 1.1.0
if ([version compare:@"1.1.0" options:NSNumericSearch] != NSOrderedAscending) {
[self initializeHighPerformanceModule];
}
NSLog(@"[SUD_SDK] Core kernel version: %@", version);Notes
- Format convention: The version number typically follows the Semantic Versioning convention, but may also include a Build Number.
- Version vs. features: Although features can be judged by the version number, it is more recommended to use
getRuntimeFeaturesto detect the availability of specific capabilities, because version numbers may not be directly comparable across different branches (such as 2D and 3D). - Required for reporting: When integrating the SDK and reporting a bug to technical support, you must provide the complete version string returned by this method.
