Skip to content

Commit 6f9ed65

Browse files
author
weiqiangliu
committed
Release 2.1.4
1 parent 9b5c2af commit 6f9ed65

File tree

7 files changed

+13
-191
lines changed

7 files changed

+13
-191
lines changed

RNSensorsAnalyticsModule.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Pod::Spec.new do |s|
33
s.name = "RNSensorsAnalyticsModule"
4-
s.version = "2.1.3"
4+
s.version = "2.1.4"
55
s.summary = "The official React Native SDK of Sensors Analytics."
66
s.description = <<-DESC
77
神策分析 RN 组件

android/src/main/java/com/sensorsdata/analytics/RNSensorsAnalyticsPackage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import java.util.List;
2929

3030
public class RNSensorsAnalyticsPackage implements ReactPackage {
31-
public static final String VERSION = "2.1.3";
31+
public static final String VERSION = "2.1.4";
3232
@Override
3333
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
3434
List<NativeModule> modules = new ArrayList<>();

ios/RNSensorsAnalyticsModule.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#import "SAReactNativeManager.h"
3333
#import "SAReactNativeEventProperty.h"
3434

35-
NSString *const kSAReactNativePluginVersion = @"react_native:2.1.3";
35+
NSString *const kSAReactNativePluginVersion = @"react_native:2.1.4";
3636

3737
@implementation RNSensorsAnalyticsModule
3838

ios/SAReactNativeManager.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,15 @@ - (RCTRootView *)rootView {
225225
current = current.presentingViewController;
226226
rootView = [self rootViewWithCurrentView:current.view];
227227
}
228+
229+
if (!rootView) {
230+
// 当 rootViewController 为普通 UIViewController,且添加了 childController 时无法获取到 RCTRootView
231+
// 此时直接通过 rootViewController 的 subview 获取 RCTRootView
232+
// 这里是通过遍历所有的 subviews 查找,作为补充逻辑存在
233+
UIViewController *root = [UIApplication sharedApplication].keyWindow.rootViewController;
234+
rootView = [self rootViewWithCurrentView:root.view];
235+
}
236+
228237
return rootView;
229238
}
230239

ios/SAReactNativeswizzler.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

ios/SAReactNativeswizzler.m

Lines changed: 0 additions & 154 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sensorsdata-analytics-react-native",
3-
"version": "2.1.3",
3+
"version": "2.1.4",
44
"private": false,
55
"description": "神策分析 RN 组件",
66
"main": "index.js",

0 commit comments

Comments
 (0)