@applicaster/quick-brick-native-apple 5.12.0 → 5.13.1
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/universal/ReactNative/ReactNativeManager.swift +25 -16
- package/package.json +1 -1
- package/apple/ios/ReactNative/AirPlayButton/AirPlayButton.m +0 -16
- package/apple/ios/ReactNative/AirPlayButton/AirPlayButton.swift +0 -56
- package/apple/ios/ReactNative/AirPlayButton/AirPlayButtonModule.swift +0 -26
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "QuickBrickApple",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.1",
|
|
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.
|
|
19
|
+
"tag": "@@applicaster/quick-brick-native-apple/5.13.1"
|
|
20
20
|
},
|
|
21
21
|
"requires_arc": true,
|
|
22
22
|
"source_files": "universal/**/*.{m,swift}",
|
|
@@ -15,7 +15,7 @@ public let kQBModuleName = "QuickBrickApp"
|
|
|
15
15
|
public let suspendApp = "suspend"
|
|
16
16
|
|
|
17
17
|
/// React Native Manager class for Quick Brick
|
|
18
|
-
open class ReactNativeManager: NSObject, UserInterfaceLayerProtocol
|
|
18
|
+
open class ReactNativeManager: NSObject, UserInterfaceLayerProtocol {
|
|
19
19
|
lazy var logger = Logger.getLogger(for: ReactNativeManagerLogs.subsystem)
|
|
20
20
|
|
|
21
21
|
public var applicationDelegate: UIApplicationDelegate?
|
|
@@ -28,20 +28,6 @@ open class ReactNativeManager: NSObject, UserInterfaceLayerProtocol, UserInterfa
|
|
|
28
28
|
|
|
29
29
|
var completion: ((_ viewController: UIViewController?, _ error: Error?) -> Void)?
|
|
30
30
|
|
|
31
|
-
public required init(launchOptions: [UIApplication.LaunchOptionsKey: Any]?,
|
|
32
|
-
applicationData: [String: Any] = [:]) {
|
|
33
|
-
super.init()
|
|
34
|
-
self.launchOptions = launchOptions
|
|
35
|
-
|
|
36
|
-
if let reactNativePackagerRoot = applicationData["reactNativePackagerRoot"] as? String {
|
|
37
|
-
self.reactNativePackagerRoot = reactNativePackagerRoot
|
|
38
|
-
}
|
|
39
|
-
applicationDelegate = self
|
|
40
|
-
userNotificationCenterDelegate = self
|
|
41
|
-
|
|
42
|
-
ReactNativeManager.applicationData = applicationData
|
|
43
|
-
}
|
|
44
|
-
|
|
45
31
|
/// url of the react server
|
|
46
32
|
private var jsBundleUrl: URL? {
|
|
47
33
|
RCTBundleURLProvider.sharedSettings()?.jsLocation = reactNativePackagerRoot
|
|
@@ -81,6 +67,22 @@ open class ReactNativeManager: NSObject, UserInterfaceLayerProtocol, UserInterfa
|
|
|
81
67
|
return retVal
|
|
82
68
|
}
|
|
83
69
|
|
|
70
|
+
// MARK: UserInterfaceLayerProtocol
|
|
71
|
+
|
|
72
|
+
public required init(launchOptions: [UIApplication.LaunchOptionsKey: Any]?,
|
|
73
|
+
applicationData: [String: Any] = [:]) {
|
|
74
|
+
super.init()
|
|
75
|
+
self.launchOptions = launchOptions
|
|
76
|
+
|
|
77
|
+
if let reactNativePackagerRoot = applicationData["reactNativePackagerRoot"] as? String {
|
|
78
|
+
self.reactNativePackagerRoot = reactNativePackagerRoot
|
|
79
|
+
}
|
|
80
|
+
applicationDelegate = self
|
|
81
|
+
userNotificationCenterDelegate = self
|
|
82
|
+
|
|
83
|
+
ReactNativeManager.applicationData = applicationData
|
|
84
|
+
}
|
|
85
|
+
|
|
84
86
|
public func prepareLayerForUse(completion: @escaping (_ viewController: UIViewController?, _ error: Error?) -> Void) {
|
|
85
87
|
setRightToLeftFlag {
|
|
86
88
|
self.mountReactApp(self.launchOptions)
|
|
@@ -88,6 +90,14 @@ open class ReactNativeManager: NSObject, UserInterfaceLayerProtocol, UserInterfa
|
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
|
|
93
|
+
#if os(iOS)
|
|
94
|
+
public func currentOrientationMask() -> UIInterfaceOrientationMask? {
|
|
95
|
+
return rootViewController?.orientationStack.last
|
|
96
|
+
}
|
|
97
|
+
#endif
|
|
98
|
+
|
|
99
|
+
// MARK: Public methods
|
|
100
|
+
|
|
91
101
|
/**
|
|
92
102
|
Creates the react bridge and the react root view. At this point, React execution starts
|
|
93
103
|
- Parameter launchOptions: launchOptions coming from AppDelegate which need to be passed to React
|
|
@@ -172,7 +182,6 @@ extension ReactNativeManager: QuickBrickManagerDelegate {
|
|
|
172
182
|
}
|
|
173
183
|
}
|
|
174
184
|
|
|
175
|
-
|
|
176
185
|
public func setPrefersHomeIndicatorAutoHidden(_ payload: Dictionary<String, Any>) {
|
|
177
186
|
FacadeConnector.connector?.uiLayer?.setPrefersHomeIndicatorAutoHidden(autoHidden: payload["autoHidden"] as? Bool ?? true)
|
|
178
187
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-native-apple",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.1",
|
|
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"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// AirPlayButton.m
|
|
3
|
-
// DefaultPlayer
|
|
4
|
-
//
|
|
5
|
-
// Created by Anna Bauza on 22/06/2020.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
@import React;
|
|
9
|
-
#import <AVFoundation/AVFoundation.h>
|
|
10
|
-
#import <React/RCTViewManager.h>
|
|
11
|
-
|
|
12
|
-
@interface RCT_EXTERN_MODULE(AirPlayButtonModule, RCTViewManager)
|
|
13
|
-
RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor);
|
|
14
|
-
RCT_EXPORT_VIEW_PROPERTY(activeTintColor, UIColor);
|
|
15
|
-
|
|
16
|
-
@end
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// AirPlayButton.swift
|
|
3
|
-
// DefaultPlayer
|
|
4
|
-
//
|
|
5
|
-
// Created by Anna Bauza on 22/06/2020.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
import AVKit
|
|
10
|
-
|
|
11
|
-
@objc public class AirPlayButton: UIView {
|
|
12
|
-
|
|
13
|
-
override init(frame: CGRect) {
|
|
14
|
-
super.init(frame: frame)
|
|
15
|
-
setupView(frame)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
required init?(coder aDecoder: NSCoder) {
|
|
19
|
-
super.init(coder: aDecoder)
|
|
20
|
-
setupView(nil)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
var airplayButton: AVRoutePickerView?
|
|
24
|
-
|
|
25
|
-
// in here you can configure your view
|
|
26
|
-
private func setupView(_ frame: CGRect?) {
|
|
27
|
-
let buttonFrame = frame ?? self.frame
|
|
28
|
-
airplayButton = AVRoutePickerView(frame: buttonFrame)
|
|
29
|
-
airplayButton?.activeTintColor = UIColor.blue
|
|
30
|
-
|
|
31
|
-
if let buttonView = airplayButton {
|
|
32
|
-
self.addSubview(buttonView)
|
|
33
|
-
buttonView.translatesAutoresizingMaskIntoConstraints = false
|
|
34
|
-
let horizontalConstraint = NSLayoutConstraint(item: buttonView, attribute: .centerX, relatedBy: .equal, toItem: self, attribute: .centerX, multiplier: 1, constant: 0)
|
|
35
|
-
let verticalConstraint = NSLayoutConstraint(item: buttonView, attribute: .centerY, relatedBy: .equal, toItem: self, attribute: .centerY, multiplier: 1, constant: 0)
|
|
36
|
-
let widthConstraint = NSLayoutConstraint(item: buttonView, attribute: .width, relatedBy: .equal, toItem: self, attribute: .width, multiplier: 1, constant: 0)
|
|
37
|
-
let heightConstraint = NSLayoutConstraint(item: buttonView, attribute: .height, relatedBy: .equal, toItem: self, attribute: .height, multiplier: 1, constant: 0)
|
|
38
|
-
self.addConstraints([horizontalConstraint, verticalConstraint, widthConstraint, heightConstraint])
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@objc override public var tintColor: UIColor? {
|
|
44
|
-
didSet {
|
|
45
|
-
airplayButton?.tintColor = tintColor
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@objc public var activeTintColor: UIColor? {
|
|
50
|
-
didSet {
|
|
51
|
-
airplayButton?.activeTintColor = activeTintColor
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RCTMyCustomViewManager.swift
|
|
3
|
-
// DefaultPlayer
|
|
4
|
-
//
|
|
5
|
-
// Created by Anna Bauza on 22/06/2020.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
import React
|
|
10
|
-
import AVFoundation
|
|
11
|
-
|
|
12
|
-
@objc(AirPlayButtonModule)
|
|
13
|
-
public class AirPlayButtonModule : RCTViewManager {
|
|
14
|
-
|
|
15
|
-
override public static func moduleName() -> String? {
|
|
16
|
-
return "AirPlayButtonModule"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public override static func requiresMainQueueSetup() -> Bool {
|
|
20
|
-
return true
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public override func view() -> UIView! {
|
|
24
|
-
return AirPlayButton()
|
|
25
|
-
}
|
|
26
|
-
}
|