react-native-firework-sdk 1.5.5-beta.1 → 1.5.6
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/android/build.gradle
CHANGED
|
@@ -167,7 +167,7 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
|
167
167
|
|
|
168
168
|
dependencies {
|
|
169
169
|
|
|
170
|
-
def firework_sdk_version = '
|
|
170
|
+
def firework_sdk_version = 'v5.14.11'
|
|
171
171
|
implementation "com.github.loopsocial:firework_sdk:$firework_sdk_version"
|
|
172
172
|
|
|
173
173
|
// noinspection GradleDynamicVersion
|
|
@@ -104,6 +104,24 @@ class FWNavigatorModule: RCTEventEmitter, FWNavigator {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
func getCloseButton(view: UIView) -> UIButton? {
|
|
108
|
+
if let button = view as? UIButton, let targetImage = button.image(for: .normal) {
|
|
109
|
+
let iOSSDKBundle = Bundle(for: FireworkVideoSDK.self)
|
|
110
|
+
if targetImage.isEqual(UIImage(named: "closeX", in: iOSSDKBundle, compatibleWith: nil))
|
|
111
|
+
|| targetImage.isEqual(UIImage(named: "down-arrow-light", in: iOSSDKBundle, compatibleWith: nil)) {
|
|
112
|
+
return button
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
for subview in view.subviews {
|
|
117
|
+
if let result = getCloseButton(view: subview) {
|
|
118
|
+
return result
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return nil
|
|
123
|
+
}
|
|
124
|
+
|
|
107
125
|
// swiftlint:enable function_body_length
|
|
108
126
|
|
|
109
127
|
@objc(popNativeContainer:rejecter:)
|
|
@@ -124,22 +142,36 @@ class FWNavigatorModule: RCTEventEmitter, FWNavigator {
|
|
|
124
142
|
} else if let presentedVC = RCTPresentedViewController(),
|
|
125
143
|
let presentingVC = presentedVC.presentingViewController,
|
|
126
144
|
presentingVC.presentingViewController == RCTKeyWindow()?.rootViewController {
|
|
127
|
-
|
|
128
|
-
|
|
145
|
+
let closeButton = self.getCloseButton(view: presentingVC.view)
|
|
146
|
+
if closeButton == nil {
|
|
147
|
+
FWNavigatorUtils.shared.shouldDisablePlay = true
|
|
148
|
+
}
|
|
129
149
|
presentedVC.dismiss(animated: false) {
|
|
130
150
|
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.1) {
|
|
131
|
-
|
|
132
|
-
|
|
151
|
+
FWNavigatorUtils.shared.shouldDisablePlay = false
|
|
152
|
+
if closeButton != nil {
|
|
153
|
+
closeButton!.sendActions(for: .touchUpInside)
|
|
133
154
|
resolver(true)
|
|
134
|
-
|
|
155
|
+
} else {
|
|
156
|
+
NotificationCenter.default.post(name: gOnVideoTemporarilyReleasePipController, object: nil)
|
|
157
|
+
presentingVC.dismiss(animated: true) {
|
|
158
|
+
NotificationCenter.default.post(name: gOnVideoRestorePipController, object: nil)
|
|
159
|
+
resolver(true)
|
|
160
|
+
}
|
|
135
161
|
}
|
|
136
162
|
}
|
|
137
163
|
}
|
|
138
|
-
} else if let rootVC = RCTKeyWindow()?.rootViewController,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
164
|
+
} else if let rootVC = RCTKeyWindow()?.rootViewController,
|
|
165
|
+
let presentedVC = rootVC.presentedViewController {
|
|
166
|
+
if let closeButton = self.getCloseButton(view: presentedVC.view) {
|
|
167
|
+
closeButton.sendActions(for: .touchUpInside)
|
|
142
168
|
resolver(true)
|
|
169
|
+
} else {
|
|
170
|
+
NotificationCenter.default.post(name: gOnVideoTemporarilyReleasePipController, object: nil)
|
|
171
|
+
presentedVC.dismiss(animated: true) {
|
|
172
|
+
NotificationCenter.default.post(name: gOnVideoRestorePipController, object: nil)
|
|
173
|
+
resolver(true)
|
|
174
|
+
}
|
|
143
175
|
}
|
|
144
176
|
} else {
|
|
145
177
|
resolver(false)
|