@applicaster/quick-brick-native-apple 6.14.3 → 6.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apple/QuickBrickApple.podspec.json +2 -2
- package/apple/ios/ReactNative/QuickBrickExceptionManagerDelegate.swift +48 -11
- package/apple/universal/ReactNative/ReactNativeModulesExports.m +1 -1
- package/apple/universal/Utils/XrayLoggerTemplates/ReactNativeManagerLogs.swift +3 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "QuickBrickApple",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.4",
|
|
4
4
|
"platforms": {
|
|
5
5
|
"ios": "16.0",
|
|
6
6
|
"tvos": "16.0"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"authors": "Applicaster LTD.",
|
|
17
17
|
"source": {
|
|
18
18
|
"git": "https://github.com/applicaster/Zapp-Frameworks.git",
|
|
19
|
-
"tag": "@@applicaster/quick-brick-native-apple/6.14.
|
|
19
|
+
"tag": "@@applicaster/quick-brick-native-apple/6.14.4"
|
|
20
20
|
},
|
|
21
21
|
"requires_arc": true,
|
|
22
22
|
"source_files": "universal/**/*.{m,swift}",
|
|
@@ -12,9 +12,15 @@ import XrayLogger
|
|
|
12
12
|
import ZappCore
|
|
13
13
|
|
|
14
14
|
class QuickBrickExceptionManagerDelegate: NSObject, RCTExceptionsManagerDelegate {
|
|
15
|
-
public lazy var logger = Logger.getLogger(for: ReactNativeManagerLogs.
|
|
15
|
+
public lazy var logger = Logger.getLogger(for: ReactNativeManagerLogs.subsystemExceptions)
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
enum Params {
|
|
18
|
+
static let message = "message"
|
|
19
|
+
static let extraInfoRawStack = "extraInfo.rawStack"
|
|
20
|
+
static let exceptionId = "exceptionId"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
func handleSoftJSException(withMessage message: String?, stack: [Any]?, exceptionId: NSNumber, extraDataAsJSON: String?) {
|
|
18
24
|
guard let message,
|
|
19
25
|
let stack
|
|
20
26
|
else {
|
|
@@ -30,13 +36,13 @@ class QuickBrickExceptionManagerDelegate: NSObject, RCTExceptionsManagerDelegate
|
|
|
30
36
|
logger?.errorLog(message: ReactNativeManagerLogs.handleSoftJSException.message,
|
|
31
37
|
category: ReactNativeManagerLogs.handleSoftJSException.category,
|
|
32
38
|
data: [
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
39
|
+
Params.message: message,
|
|
40
|
+
Params.extraInfoRawStack: extraDataAsJSON ?? "",
|
|
41
|
+
Params.exceptionId: "\(exceptionId)",
|
|
36
42
|
])
|
|
37
43
|
}
|
|
38
44
|
|
|
39
|
-
func handleFatalJSException(withMessage message: String?, stack: [Any]?, exceptionId: NSNumber, extraDataAsJSON
|
|
45
|
+
func handleFatalJSException(withMessage message: String?, stack: [Any]?, exceptionId: NSNumber, extraDataAsJSON: String?) {
|
|
40
46
|
guard let message,
|
|
41
47
|
let stack
|
|
42
48
|
else {
|
|
@@ -49,12 +55,43 @@ class QuickBrickExceptionManagerDelegate: NSObject, RCTExceptionsManagerDelegate
|
|
|
49
55
|
type: .error,
|
|
50
56
|
message, stack)
|
|
51
57
|
|
|
58
|
+
let data = [
|
|
59
|
+
Params.message: message,
|
|
60
|
+
Params.extraInfoRawStack: extraDataAsJSON ?? "",
|
|
61
|
+
Params.exceptionId: "\(exceptionId)",
|
|
62
|
+
EventsRelatedKeys.Generic.crashId: (extraDataAsJSON ?? message).md5().lowercased(),
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
Task { @MainActor in
|
|
66
|
+
storeFatalJSException(message,
|
|
67
|
+
data: data,
|
|
68
|
+
exceptionId: exceptionId,
|
|
69
|
+
extraDataAsJSON: extraDataAsJSON)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// try to post exception to the logger
|
|
52
73
|
logger?.errorLog(message: ReactNativeManagerLogs.handleFatalJSException.message,
|
|
53
74
|
category: ReactNativeManagerLogs.handleFatalJSException.category,
|
|
54
|
-
data:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
75
|
+
data: data)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@MainActor
|
|
79
|
+
func storeFatalJSException(_ message: String,
|
|
80
|
+
data: [String: Any],
|
|
81
|
+
exceptionId _: NSNumber,
|
|
82
|
+
extraDataAsJSON _: String?) {
|
|
83
|
+
let isDebugEnvironment = FacadeConnector.instance?.applicationData?.isDebugEnvironment() ?? false
|
|
84
|
+
guard !isDebugEnvironment else {
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let event = logger?.getEvent(message: ReactNativeManagerLogs.handleFatalJSException.message,
|
|
89
|
+
category: ReactNativeManagerLogs.handleFatalJSException.category,
|
|
90
|
+
data: data,
|
|
91
|
+
logLevel: .error)
|
|
92
|
+
if let dict = event?.toDictionary() {
|
|
93
|
+
UserDefaults.standard.setValue(dict,
|
|
94
|
+
forKey: EventsRelatedKeys.UserDefaults.lastFatalJsException)
|
|
95
|
+
}
|
|
59
96
|
}
|
|
60
97
|
}
|
|
@@ -30,7 +30,7 @@ RCT_EXTERN_METHOD(setAppLanguage:(NSString *)language
|
|
|
30
30
|
|
|
31
31
|
@interface RCT_EXTERN_MODULE (AnalyticsBridge, NSObject)
|
|
32
32
|
RCT_EXTERN_METHOD(postEvent:(NSString *)event
|
|
33
|
-
|
|
33
|
+
payload:(NSDictionary *)payload);
|
|
34
34
|
RCT_EXTERN_METHOD(postTimedEvent:(NSString *)event
|
|
35
35
|
payload:(NSDictionary *)payload);
|
|
36
36
|
RCT_EXTERN_METHOD(endTimedEvent:(NSString *)event
|
|
@@ -12,12 +12,13 @@ import ZappCore
|
|
|
12
12
|
|
|
13
13
|
public struct ReactNativeManagerLogs: XrayLoggerTemplateProtocol {
|
|
14
14
|
public static var subsystem: String = "\(kNativeSubsystemPath)/react_native_manager"
|
|
15
|
+
public static var subsystemExceptions: String = "\(kNativeSubsystemPath)/react_native_manager/exceptions"
|
|
15
16
|
|
|
16
17
|
public static var mountingReactApp = LogTemplate(message: "Mounting React App")
|
|
17
18
|
public static var noReactBridge = LogTemplate(message: "No React Bridge")
|
|
18
19
|
public static var presentingReactViewController = LogTemplate(message: "Presenting React ViewController")
|
|
19
20
|
public static var setRightToLeftFlagError = LogTemplate(message: "Error setting RTL")
|
|
20
21
|
public static var failedToLoadJson = LogTemplate(message: "Failed to load json")
|
|
21
|
-
public static var handleSoftJSException = LogTemplate(message: "Soft JS Exception")
|
|
22
|
-
public static var handleFatalJSException = LogTemplate(message: "Fatal JS Exception")
|
|
22
|
+
public static var handleSoftJSException = LogTemplate(message: "Soft JS Exception", category: EventsRelatedKeys.CrashType.jsSoft.rawValue)
|
|
23
|
+
public static var handleFatalJSException = LogTemplate(message: "Fatal JS Exception", category: EventsRelatedKeys.CrashType.jsFatal.rawValue)
|
|
23
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-native-apple",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.4",
|
|
4
4
|
"description": "iOS and tvOS native code for QuickBrick applications. This package is used to provide native logic for QuickBrick",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|