@applicaster/quick-brick-native-apple 5.14.1 → 5.14.2-alpha.2

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.14.1",
3
+ "version": "5.14.2-alpha.2",
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.14.1"
19
+ "tag": "@@applicaster/quick-brick-native-apple/5.14.2-alpha.2"
20
20
  },
21
21
  "requires_arc": true,
22
22
  "source_files": "universal/**/*.{m,swift}",
@@ -14,6 +14,7 @@ import ZappCore
14
14
 
15
15
  public let kQBModuleName = "QuickBrickApp"
16
16
  public let suspendApp = "suspend"
17
+ public let kQBLoadingTimeout: TimeInterval = 20
17
18
 
18
19
  /// React Native Manager class for Quick Brick
19
20
  open class ReactNativeManager: NSObject, UserInterfaceLayerProtocol, UserInterfaceLayerDelegate {
@@ -23,7 +24,7 @@ open class ReactNativeManager: NSObject, UserInterfaceLayerProtocol, UserInterfa
23
24
 
24
25
  var launchOptions: [UIApplication.LaunchOptionsKey: Any]?
25
26
  var reactNativePackagerRoot: String?
26
-
27
+ var timeoutTimer: Timer?
27
28
  var completion: ((_ viewController: UIViewController?, _ error: Error?) -> Void)?
28
29
 
29
30
  /// url of the react server
@@ -88,6 +89,12 @@ open class ReactNativeManager: NSObject, UserInterfaceLayerProtocol, UserInterfa
88
89
 
89
90
  public func prepareLayerForUse(completion: @escaping (_ viewController: UIViewController?, _ error: Error?) -> Void) {
90
91
  setRightToLeftFlag {
92
+ self.timeoutTimer = Timer.scheduledTimer(withTimeInterval: kQBLoadingTimeout,
93
+ repeats: false,
94
+ block: { _ in
95
+ EventsBus.post(EventsBus.Event(type: EventsBusType(.userInterfaceLayerLoadingDelayed),
96
+ data: self.launchOptions ?? [:]))
97
+ })
91
98
  self.mountReactApp(self.launchOptions)
92
99
  self.completion = completion
93
100
  }
@@ -183,6 +190,7 @@ extension ReactNativeManager: RCTBridgeDelegate {
183
190
 
184
191
  extension ReactNativeManager: QuickBrickManagerDelegate {
185
192
  public func setQuickBrickReady() {
193
+ timeoutTimer?.invalidate()
186
194
  completion?(reactNativeViewController(), nil)
187
195
  completion = nil
188
196
  }
@@ -226,4 +234,4 @@ extension ReactNativeManager: QuickBrickManagerDelegate {
226
234
  public func forceAppReload() {
227
235
  EventsBus.post(EventsBus.Event(type: EventsBusType(.forceAppReload)))
228
236
  }
229
- }
237
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-native-apple",
3
- "version": "5.14.1",
3
+ "version": "5.14.2-alpha.2",
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"