Skip to content

Commit

Permalink
fix(ios): change sdkVersion variable name , keep compatible with hippy2
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Nov 8, 2023
1 parent a84c3e0 commit f3d0542
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)viewDidLoad {

self.imageView.image = [UIImage imageFromIconName:@"first_page_logo"];

self.verLabel.text = [NSString stringWithFormat:@"Ver:%@", HippySDKVersion];
self.verLabel.text = [NSString stringWithFormat:@"Ver:%@", _HippySDKVersion];

self.buttonView.layer.shadowColor = [UIColor grayColor].CGColor;
self.buttonView.layer.shadowOffset = CGSizeMake(0, -1);
Expand Down
3 changes: 2 additions & 1 deletion framework/ios/base/bridge/HippyBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ NS_ASSUME_NONNULL_BEGIN

/**
* Indicate hippy sdk version
* 注意:为兼容2.0版本,保持的相同的下划线前缀命名,不可修改
*/
HIPPY_EXTERN NSString *const HippySDKVersion;
HIPPY_EXTERN NSString *const _HippySDKVersion;
/**
* This notification triggers a reload of all bridges currently running.
* Deprecated, use HippyBridge::requestReload instead.
Expand Down
6 changes: 3 additions & 3 deletions framework/ios/base/bridge/HippyBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
NSString *const HippyJavaScriptDidLoadNotification = @"HippyJavaScriptDidLoadNotification";
NSString *const HippyJavaScriptDidFailToLoadNotification = @"HippyJavaScriptDidFailToLoadNotification";
NSString *const HippyDidInitializeModuleNotification = @"HippyDidInitializeModuleNotification";
NSString *const HippySDKVersion = @HIPPY_STR(HIPPY_VERSION);
NSString *const _HippySDKVersion = @HIPPY_STR(HIPPY_VERSION);


static NSString *const HippyNativeGlobalKeyOS = @"OS";
Expand Down Expand Up @@ -513,7 +513,7 @@ - (void)innerLoadInstanceForRootView:(NSNumber *)rootTag withProperties:(NSDicti
NSDictionary *param = @{@"name": _moduleName,
@"id": rootTag,
@"params": props ?: @{},
@"version": HippySDKVersion};
@"version": _HippySDKVersion};
footstone::value::HippyValue value = [param toHippyValue];
std::shared_ptr<footstone::value::HippyValue> domValue = std::make_shared<footstone::value::HippyValue>(value);
self.javaScriptExecutor.pScope->LoadInstance(domValue);
Expand Down Expand Up @@ -991,7 +991,7 @@ - (NSDictionary *)genRawDeviceInfoDict {
[deviceInfo setValue:@"ios" forKey:HippyNativeGlobalKeyOS];
[deviceInfo setValue:iosVersion forKey:HippyNativeGlobalKeyOSVersion];
[deviceInfo setValue:deviceModel forKey:HippyNativeGlobalKeyDevice];
[deviceInfo setValue:HippySDKVersion forKey:HippyNativeGlobalKeySDKVersion];
[deviceInfo setValue:_HippySDKVersion forKey:HippyNativeGlobalKeySDKVersion];

NSString *appVer = [[NSBundle.mainBundle infoDictionary] objectForKey:@"CFBundleShortVersionString"];
if (appVer) {
Expand Down
5 changes: 4 additions & 1 deletion modules/ios/base/HippyUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ HIPPY_EXTERN NSStringEncoding HippyGetStringEncodingFromURLResponse(NSURLRespons
#pragma mark -

/// 工具类
/// 注意,类名及方法名禁止修改
@interface HippyUtils : NSObject

/// SDK版本号
/// HippySDK版本号
///
/// 注意方法名禁止修改,外部可能会动态调用,判断Hippy版本号
+ (NSString *)sdkVersion;

@end
Expand Down

0 comments on commit f3d0542

Please sign in to comment.