22 行
579 B
Mathematica
22 行
579 B
Mathematica
|
|
#import <React/RCTBridgeModule.h>
|
||
|
|
|
||
|
|
@interface XuqmVersionModule : NSObject <RCTBridgeModule>
|
||
|
|
@end
|
||
|
|
|
||
|
|
@implementation XuqmVersionModule
|
||
|
|
|
||
|
|
RCT_EXPORT_MODULE();
|
||
|
|
|
||
|
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getVersionCode) {
|
||
|
|
NSString *build = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
|
||
|
|
return @([build integerValue]);
|
||
|
|
}
|
||
|
|
|
||
|
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getVersionName) {
|
||
|
|
NSString *version = [[[NSBundle mainBundle] infoDictionary]
|
||
|
|
objectForKey:@"CFBundleShortVersionString"];
|
||
|
|
return version ?: @"0.0.0";
|
||
|
|
}
|
||
|
|
|
||
|
|
@end
|