Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): change sdkVersion variable name , keep compatible with hippy2 #3600

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading