@applicaster/quick-brick-native-apple 5.13.2 → 5.14.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "QuickBrickApple",
3
- "version": "5.13.2",
3
+ "version": "5.14.0",
4
4
  "platforms": {
5
5
  "ios": "12.0",
6
6
  "tvos": "12.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/5.13.2"
19
+ "tag": "@@applicaster/quick-brick-native-apple/5.14.0"
20
20
  },
21
21
  "requires_arc": true,
22
22
  "source_files": "universal/**/*.{m,swift}",
@@ -0,0 +1,58 @@
1
+ //
2
+ // QuickBrickExceptionManager.swift
3
+ // QuickBrickApple
4
+ //
5
+ // Created by Alex Zchut on 02/16/22.
6
+ //
7
+
8
+ import os.log
9
+ import React
10
+ import UIKit
11
+ import XrayLogger
12
+ import ZappCore
13
+
14
+ class QuickBrickExceptionManager: RCTExceptionsManager, RCTExceptionsManagerDelegate {
15
+ public lazy var logger = Logger.getLogger(for: ReactNativeManagerLogs.subsystem)
16
+
17
+ func handleSoftJSException(withMessage message: String?, stack: [Any]?, exceptionId: NSNumber) {
18
+ guard let message = message,
19
+ let stack = stack else {
20
+ return
21
+ }
22
+
23
+ let logOrigin = OSLog(subsystem: "\(Self.self)", category: "handleSoftJSException")
24
+ os_log("handleSoftJSException message: %@, stack: %@",
25
+ log: logOrigin,
26
+ type: .error,
27
+ message, stack)
28
+
29
+ logger?.errorLog(message: ReactNativeManagerLogs.handleSoftJSException.message,
30
+ category: ReactNativeManagerLogs.handleSoftJSException.category,
31
+ data: [
32
+ "message": message,
33
+ "stack": stack,
34
+ "exceptionId": "\(exceptionId)",
35
+ ])
36
+ }
37
+
38
+ func handleFatalJSException(withMessage message: String?, stack: [Any]?, exceptionId: NSNumber) {
39
+ guard let message = message,
40
+ let stack = stack else {
41
+ return
42
+ }
43
+
44
+ let logOrigin = OSLog(subsystem: "\(Self.self)", category: "handleFatalJSException")
45
+ os_log("handleFatalJSException message: %{public}@, stack: %{public}@",
46
+ log: logOrigin,
47
+ type: .error,
48
+ message, stack)
49
+
50
+ logger?.errorLog(message: ReactNativeManagerLogs.handleFatalJSException.message,
51
+ category: ReactNativeManagerLogs.handleFatalJSException.category,
52
+ data: [
53
+ "message": message,
54
+ "stack": stack,
55
+ "exceptionId": "\(exceptionId)",
56
+ ])
57
+ }
58
+ }
@@ -6,6 +6,7 @@
6
6
  // Copyright © 2018 Applicaster LTD. All rights reserved.
7
7
  //
8
8
 
9
+ import os.log
9
10
  import React
10
11
  import UIKit
11
12
  import XrayLogger
@@ -169,6 +170,15 @@ extension ReactNativeManager: RCTBridgeDelegate {
169
170
  }
170
171
  return nil
171
172
  }
173
+
174
+ #if os(iOS)
175
+ public func extraModules(for bridge: RCTBridge!) -> [RCTBridgeModule]! {
176
+ let qbExceptionManager = QuickBrickExceptionManager()
177
+ let rctException = RCTExceptionsManager(delegate: qbExceptionManager)
178
+
179
+ return [rctException, qbExceptionManager]
180
+ }
181
+ #endif
172
182
  }
173
183
 
174
184
  extension ReactNativeManager: QuickBrickManagerDelegate {
@@ -216,4 +226,4 @@ extension ReactNativeManager: QuickBrickManagerDelegate {
216
226
  public func forceAppReload() {
217
227
  EventsBus.post(EventsBus.Event(type: EventsBusType(.forceAppReload)))
218
228
  }
219
- }
229
+ }
@@ -19,4 +19,6 @@ public struct ReactNativeManagerLogs: XrayLoggerTemplateProtocol {
19
19
  public static var presentingReactViewController = LogTemplate(message: "Presenting React ViewController")
20
20
  public static var setRightToLeftFlagError = LogTemplate(message: "Error setting RTL")
21
21
  public static var failedToLoadJson = LogTemplate(message: "Failed to load json")
22
+ public static var handleSoftJSException = LogTemplate(message: "Soft JS Exception")
23
+ public static var handleFatalJSException = LogTemplate(message: "Fatal JS Exception")
22
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-native-apple",
3
- "version": "5.13.2",
3
+ "version": "5.14.0",
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"