nitro-web-browser 0.0.0-stage → 0.1.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/LICENSE +27 -0
- package/Package.swift +126 -0
- package/README.md +169 -2
- package/android/build.gradle +4 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/BrowserProxyActivity.kt +83 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/BrowserRedirectActivity.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/CustomTabsActivitiesHelper.kt +94 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/CustomTabsConnectionHelper.kt +268 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/CustomTabsIntentFactory.kt +46 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/DeferredClientActionsQueue.kt +38 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/HybridWebBrowser.kt +250 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/WebBrowserActivityInitializer.kt +18 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/WebBrowserAndroidRuntime.kt +31 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/WebBrowserErrors.kt +17 -0
- package/ios/HybridWebBrowser.swift +230 -0
- package/ios/SceneGeometry.swift +35 -0
- package/ios/WebAuthSession.swift +113 -0
- package/ios/WebBrowserOptions.swift +58 -0
- package/ios/WebBrowserSession.swift +85 -0
- package/nitro.json +21 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroWebBrowser+autolinking.cmake +42 -0
- package/nitrogen/generated/android/NitroWebBrowser+autolinking.gradle +10 -0
- package/nitrogen/generated/android/NitroWebBrowserOnLoad.cpp +24 -0
- package/nitrogen/generated/android/c++/JCallback_void.cpp +54 -0
- package/nitrogen/generated/android/c++/JCallback_void_NativeAppStateStatus.cpp +55 -0
- package/nitrogen/generated/android/c++/JCallback_void_NativeRedirectEvent.cpp +55 -0
- package/nitrogen/generated/android/c++/JHybridWebBrowserSpec.cpp +168 -0
- package/nitrogen/generated/android/c++/JListenerSubscription.cpp +34 -0
- package/nitrogen/generated/android/c++/JNativeAppStateStatus.cpp +61 -0
- package/nitrogen/generated/android/c++/JNativeRedirectEvent.cpp +34 -0
- package/nitrogen/generated/android/c++/JNativeServiceActionResult.cpp +36 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserAuthSessionResult.cpp +39 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserAuthSessionResultType.cpp +55 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserCustomTabsResults.cpp +41 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserDismissButtonStyle.cpp +55 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserOpenOptions.cpp +57 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserPresentationStyle.cpp +70 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserResult.cpp +33 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserResultType.cpp +58 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JCallback_void.hpp +53 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JCallback_void_NativeAppStateStatus.hpp +54 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JCallback_void_NativeRedirectEvent.hpp +54 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JHybridWebBrowserSpec.hpp +111 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JHybridWebBrowserSpecJavaPart.hpp +26 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JListenerSubscription.hpp +49 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeAppStateStatus.hpp +87 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeRedirectEvent.hpp +49 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeServiceActionResult.hpp +51 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserAuthSessionResult.hpp +62 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserAuthSessionResultType.hpp +77 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserCustomTabsResults.hpp +68 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserDismissButtonStyle.hpp +77 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserOpenOptions.hpp +132 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserPresentationStyle.hpp +102 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserResult.hpp +48 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserResultType.hpp +82 -0
- package/nitrogen/generated/android/include/NitroWebBrowser/private/NitroWebBrowserOnLoad.hpp +13 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/Callback_void.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/Callback_void_NativeAppStateStatus.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/Callback_void_NativeRedirectEvent.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/HybridWebBrowserSpec.kt +191 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/ListenerSubscription.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeAppStateStatus.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeRedirectEvent.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeServiceActionResult.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserAuthSessionResult.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserAuthSessionResultType.kt +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserCustomTabsResults.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserDismissButtonStyle.kt +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserOpenOptions.kt +122 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserPresentationStyle.kt +64 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserResult.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserResultType.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NitroWebBrowserOnLoad.kt +22 -0
- package/nitrogen/generated/apple/NitroWebBrowser-Swift-Cxx-Bridge.cpp +182 -0
- package/nitrogen/generated/apple/NitroWebBrowserAppleCxx/NitroWebBrowserAppleCxx.cpp +9 -0
- package/nitrogen/generated/apple/NitroWebBrowserAppleCxx/include/NitroWebBrowserAppleCxx/NitroWebBrowserAppleCxx.h +103 -0
- package/nitrogen/generated/apple/NitroWebBrowserAutolinking.cpp +20 -0
- package/nitrogen/generated/apple/NitroWebBrowserAutolinking.mm +24 -0
- package/nitrogen/generated/apple/c++/HybridWebBrowserSpecSwift.cpp +173 -0
- package/nitrogen/generated/apple/c++/HybridWebBrowserSpec_cxx-Swift.cpp +28 -0
- package/nitrogen/generated/apple/c++/ListenerSubscription-Swift.cpp +37 -0
- package/nitrogen/generated/apple/c++/NativeAppStateStatus-Swift.cpp +55 -0
- package/nitrogen/generated/apple/c++/NativeRedirectEvent-Swift.cpp +32 -0
- package/nitrogen/generated/apple/c++/NativeServiceActionResult-Swift.cpp +32 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserAuthSessionResult-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserAuthSessionResultType-Swift.cpp +49 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserCustomTabsResults-Swift.cpp +35 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserDismissButtonStyle-Swift.cpp +49 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserOpenOptions-Swift.cpp +47 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserPresentationStyle-Swift.cpp +64 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserResult-Swift.cpp +32 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserResultType-Swift.cpp +52 -0
- package/nitrogen/generated/apple/c++/Record_swift__String_swift__String-Swift.cpp +26 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/NitroWebBrowserAutolinking.hpp +13 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/HybridWebBrowserSpecSwift.hpp +84 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/HybridWebBrowserSpec_cxx-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/ListenerSubscription-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeAppStateStatus-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeRedirectEvent-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeServiceActionResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserAuthSessionResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserAuthSessionResultType-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserCustomTabsResults-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserDismissButtonStyle-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserOpenOptions-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserPresentationStyle-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserResultType-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NitroWebBrowser-Swift-Cxx-Umbrella.hpp +50 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/Record_swift__String_swift__String-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/module.modulemap +12 -0
- package/nitrogen/generated/apple/swift/Callback_void.swift +60 -0
- package/nitrogen/generated/apple/swift/Callback_void___NitroWebBrowser__NativeAppStateStatus.swift +66 -0
- package/nitrogen/generated/apple/swift/Callback_void___NitroWebBrowser__NativeRedirectEvent.swift +66 -0
- package/nitrogen/generated/apple/swift/HybridWebBrowserSpec.swift +77 -0
- package/nitrogen/generated/apple/swift/HybridWebBrowserSpec_cxx.swift +268 -0
- package/nitrogen/generated/apple/swift/ListenerSubscription.swift +29 -0
- package/nitrogen/generated/apple/swift/NativeAppStateStatus.swift +69 -0
- package/nitrogen/generated/apple/swift/NativeRedirectEvent.swift +28 -0
- package/nitrogen/generated/apple/swift/NativeServiceActionResult.swift +28 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserAuthSessionResult.swift +42 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserAuthSessionResultType.swift +59 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserCustomTabsResults.swift +49 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserDismissButtonStyle.swift +59 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserOpenOptions.swift +133 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserPresentationStyle.swift +84 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserResult.swift +28 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserResultType.swift +64 -0
- package/nitrogen/generated/apple/swift/Promise___NitroWebBrowser__NativeServiceActionResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroWebBrowser__NativeWebBrowserAuthSessionResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroWebBrowser__NativeWebBrowserCustomTabsResults.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroWebBrowser__NativeWebBrowserResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise_void.swift +100 -0
- package/nitrogen/generated/apple/swift/Record_swift__String_swift__String.swift +48 -0
- package/nitrogen/generated/hybrid-classes.json +19 -0
- package/nitrogen/generated/shared/c++/NitroWebBrowserCxxModule.cpp +2 -0
- package/nitrogen/generated/shared/c++/include/NitroWebBrowser/NitroWebBrowserCxxModule.hpp +2 -0
- package/nitrogen/generated/shared/javascript/WebBrowser.cjs +19 -0
- package/nitrogen/generated/shared/javascript/WebBrowser.d.cts +9 -0
- package/package.json +44 -4
- package/src/ListenerSubscription.ts +3 -0
- package/src/WebBrowser.ts +279 -0
- package/src/WebBrowser.types.ts +284 -0
- package/src/index.ts +27 -0
- package/src/native.ts +9 -0
- package/src/platform/AppState.ts +22 -0
- package/src/platform/Linking.ts +17 -0
- package/src/specs/WebBrowser.nitro.ts +87 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 nitro-packages contributors
|
|
4
|
+
|
|
5
|
+
Portions of the repository structure and release tooling are adapted from margelo/nitro-ui
|
|
6
|
+
Copyright (c) 2026 Margelo
|
|
7
|
+
|
|
8
|
+
Portions of nitro-web-browser are adapted from expo-web-browser
|
|
9
|
+
Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
package/Package.swift
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// swift-tools-version: 6.4
|
|
2
|
+
|
|
3
|
+
import Foundation
|
|
4
|
+
import PackageDescription
|
|
5
|
+
|
|
6
|
+
let name = "NitroWebBrowser"
|
|
7
|
+
let generated = "nitrogen/generated"
|
|
8
|
+
let nitroDependencies: [Target.Dependency] = [
|
|
9
|
+
.product(name: "NitroModules", package: "nitro-core")
|
|
10
|
+
]
|
|
11
|
+
let cxxSettings: [CXXSetting] = [
|
|
12
|
+
.define("DEBUG", .when(configuration: .debug)),
|
|
13
|
+
.define("NDEBUG", .when(configuration: .release)),
|
|
14
|
+
.disableWarning("nullability-extension"),
|
|
15
|
+
]
|
|
16
|
+
let swiftSources = ["ios", "\(generated)/apple/swift"]
|
|
17
|
+
let bridgeSources = ["c++", "NitroWebBrowser-Swift-Cxx-Bridge.cpp", "NitroWebBrowserAutolinking.cpp"]
|
|
18
|
+
// Handwritten C++ in cpp/ is shared with Android and compiles with the generated shared C++.
|
|
19
|
+
let userCxxSources = ["cpp"].filter(exists)
|
|
20
|
+
let cxxSources = ["\(generated)/shared/c++"] + userCxxSources
|
|
21
|
+
func userHeaderSearchPaths(relativeTo targetPath: String) -> [CXXSetting] {
|
|
22
|
+
let packageDirectory = URL(fileURLWithPath: Context.packageDirectory)
|
|
23
|
+
let targetComponents = packageDirectory.appendingPathComponent(targetPath).standardizedFileURL.pathComponents
|
|
24
|
+
return userCxxSources.map { source in
|
|
25
|
+
let sourceURL = packageDirectory.appendingPathComponent(source)
|
|
26
|
+
var isDirectory: ObjCBool = false
|
|
27
|
+
FileManager.default.fileExists(atPath: sourceURL.path, isDirectory: &isDirectory)
|
|
28
|
+
let directory = isDirectory.boolValue ? sourceURL : sourceURL.deletingLastPathComponent()
|
|
29
|
+
let headerComponents = directory.standardizedFileURL.pathComponents
|
|
30
|
+
let commonCount = zip(targetComponents, headerComponents).prefix { $0.0 == $0.1 }.count
|
|
31
|
+
let relativeComponents =
|
|
32
|
+
Array(repeating: "..", count: targetComponents.count - commonCount)
|
|
33
|
+
+ headerComponents.dropFirst(commonCount)
|
|
34
|
+
return .headerSearchPath(relativeComponents.isEmpty ? "." : relativeComponents.joined(separator: "/"))
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Bare-host integration. Nitrogen generates the bindings; this manifest owns the targets.
|
|
39
|
+
let package = Package(
|
|
40
|
+
name: name,
|
|
41
|
+
platforms: [.iOS(.v16), .macOS(.v13)],
|
|
42
|
+
products: [
|
|
43
|
+
.library(name: name, targets: ["\(name)Cxx", name, "\(name)SwiftBridge"])
|
|
44
|
+
],
|
|
45
|
+
dependencies: [
|
|
46
|
+
.package(path: "../nitro-core")
|
|
47
|
+
],
|
|
48
|
+
targets: [
|
|
49
|
+
.target(
|
|
50
|
+
name: "\(name)Cxx",
|
|
51
|
+
dependencies: nitroDependencies,
|
|
52
|
+
path: ".",
|
|
53
|
+
exclude: excludes(in: ".", keeping: cxxSources),
|
|
54
|
+
sources: cxxSources,
|
|
55
|
+
publicHeadersPath: "\(generated)/shared/c++/include",
|
|
56
|
+
cxxSettings: cxxSettings + userHeaderSearchPaths(relativeTo: ".")
|
|
57
|
+
),
|
|
58
|
+
.target(
|
|
59
|
+
name: "\(name)AppleCxx",
|
|
60
|
+
dependencies: [.target(name: "\(name)Cxx")] + nitroDependencies,
|
|
61
|
+
path: "\(generated)/apple/\(name)AppleCxx",
|
|
62
|
+
cxxSettings: cxxSettings
|
|
63
|
+
),
|
|
64
|
+
.target(
|
|
65
|
+
name: name,
|
|
66
|
+
dependencies: [.target(name: "\(name)AppleCxx")] + nitroDependencies,
|
|
67
|
+
path: ".",
|
|
68
|
+
exclude: excludes(in: ".", keeping: swiftSources),
|
|
69
|
+
sources: swiftSources,
|
|
70
|
+
cxxSettings: cxxSettings,
|
|
71
|
+
swiftSettings: [
|
|
72
|
+
// UIKit implementations run synchronously on the host's main thread.
|
|
73
|
+
.swiftLanguageMode(.v5),
|
|
74
|
+
.unsafeFlags(["-strict-concurrency=minimal"]),
|
|
75
|
+
.enableUpcomingFeature("InternalImportsByDefault"),
|
|
76
|
+
.enableUpcomingFeature("MemberImportVisibility"),
|
|
77
|
+
.interoperabilityMode(.Cxx),
|
|
78
|
+
.unsafeFlags(["-Xfrontend", "-clang-header-expose-decls=has-expose-attr-or-stdlib"]),
|
|
79
|
+
.unsafeFlags([
|
|
80
|
+
"-Xfrontend", "-clang-header-expose-module",
|
|
81
|
+
"-Xfrontend", "NitroModules=NitroModules-Swift.h",
|
|
82
|
+
]),
|
|
83
|
+
]
|
|
84
|
+
),
|
|
85
|
+
.target(
|
|
86
|
+
name: "\(name)SwiftBridge",
|
|
87
|
+
dependencies: [.target(name: name), .target(name: "\(name)AppleCxx")] + nitroDependencies,
|
|
88
|
+
path: "\(generated)/apple",
|
|
89
|
+
exclude: excludes(in: "\(generated)/apple", keeping: bridgeSources) + ["c++/include"],
|
|
90
|
+
sources: bridgeSources,
|
|
91
|
+
publicHeadersPath: "c++/include",
|
|
92
|
+
cxxSettings: cxxSettings + userHeaderSearchPaths(relativeTo: "\(generated)/apple") + [
|
|
93
|
+
.unsafeFlags(["-I${GENERATED_MODULEMAP_DIR}", "-fno-modules"])
|
|
94
|
+
]
|
|
95
|
+
),
|
|
96
|
+
],
|
|
97
|
+
cxxLanguageStandard: .cxx20
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
func exists(_ path: String) -> Bool {
|
|
101
|
+
FileManager.default.fileExists(
|
|
102
|
+
atPath: URL(fileURLWithPath: Context.packageDirectory).appendingPathComponent(path).path
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
func excludes(in path: String, keeping sources: [String]) -> [String] {
|
|
107
|
+
var parents: Set<String> = [""]
|
|
108
|
+
for source in sources {
|
|
109
|
+
var components = source.split(separator: "/").dropLast()
|
|
110
|
+
while !components.isEmpty {
|
|
111
|
+
parents.insert(components.joined(separator: "/"))
|
|
112
|
+
components = components.dropLast()
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
let root = URL(fileURLWithPath: Context.packageDirectory).appendingPathComponent(path)
|
|
116
|
+
return parents.sorted().flatMap { parent in
|
|
117
|
+
let entries =
|
|
118
|
+
(try? FileManager.default.contentsOfDirectory(
|
|
119
|
+
atPath: root.appendingPathComponent(parent).path)) ?? []
|
|
120
|
+
return entries.sorted().compactMap { entry in
|
|
121
|
+
let entryPath = parent.isEmpty ? entry : "\(parent)/\(entry)"
|
|
122
|
+
return entry.hasPrefix(".") || sources.contains(entryPath) || parents.contains(entryPath)
|
|
123
|
+
? nil : entryPath
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
package/README.md
CHANGED
|
@@ -1,3 +1,170 @@
|
|
|
1
|
-
#
|
|
1
|
+
# nitro-web-browser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
System browser and web authentication sessions for NitroUI, ported from the native-relevant parts of `expo-web-browser`.
|
|
4
|
+
|
|
5
|
+
The package opens an in-app browser for ordinary web content and a system authentication session for OAuth-style sign-in flows. It targets iOS 16+ and Android API 26+.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Install the package in a NitroUI application:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install nitro-web-browser
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or with Bun:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
bun add nitro-web-browser
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
After adding it, run the normal NitroUI preparation and native build commands for that application.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Open a browser:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { openBrowserAsync } from 'nitro-web-browser'
|
|
29
|
+
|
|
30
|
+
await openBrowserAsync('https://nitro-ui.com', {
|
|
31
|
+
toolbarColor: '#ffffff',
|
|
32
|
+
controlsColor: '#007aff',
|
|
33
|
+
})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Open an authentication session:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { openAuthSessionAsync } from 'nitro-web-browser'
|
|
40
|
+
|
|
41
|
+
const result = await openAuthSessionAsync(
|
|
42
|
+
'https://provider.example/oauth/authorize?client_id=example',
|
|
43
|
+
'myapp://auth'
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
if (result.type === 'success') {
|
|
47
|
+
console.log(result.url)
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`maybeCompleteAuthSession()` is a web-oriented compatibility API. On native platforms it returns a failure result when there is no browser flow to complete. `dismissBrowser()` and `dismissAuthSession()` request programmatic dismissal where the platform supports it. Android Custom Tabs generally cannot be dismissed programmatically, so those operations can reject on Android.
|
|
52
|
+
|
|
53
|
+
Android applications can use the Custom Tabs service lifecycle helpers when they need lower-level control:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import {
|
|
57
|
+
coolDownAsync,
|
|
58
|
+
getCustomTabsSupportingBrowsersAsync,
|
|
59
|
+
mayInitWithUrlAsync,
|
|
60
|
+
warmUpAsync,
|
|
61
|
+
} from 'nitro-web-browser'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Android application setup
|
|
65
|
+
|
|
66
|
+
The consuming application must expose Custom Tabs service discovery and register the package-owned browser activities in its `AndroidManifest.xml`.
|
|
67
|
+
|
|
68
|
+
Add the Custom Tabs service query inside the top-level `<manifest>` element:
|
|
69
|
+
|
|
70
|
+
```xml
|
|
71
|
+
<queries>
|
|
72
|
+
<intent>
|
|
73
|
+
<action android:name="android.support.customtabs.action.CustomTabsService" />
|
|
74
|
+
</intent>
|
|
75
|
+
</queries>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Register the internal proxy activity inside `<application>`:
|
|
79
|
+
|
|
80
|
+
```xml
|
|
81
|
+
<activity
|
|
82
|
+
android:name="com.margelo.nitro.webbrowser.BrowserProxyActivity"
|
|
83
|
+
android:taskAffinity=".webContainer"
|
|
84
|
+
android:launchMode="singleTop"
|
|
85
|
+
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
|
86
|
+
android:exported="false" />
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
For every redirect scheme used by `openAuthSessionAsync`, register `BrowserRedirectActivity` with an exported, browsable `VIEW` intent filter. Replace `myapp` with the application's redirect scheme:
|
|
90
|
+
|
|
91
|
+
```xml
|
|
92
|
+
<activity
|
|
93
|
+
android:name="com.margelo.nitro.webbrowser.BrowserRedirectActivity"
|
|
94
|
+
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
|
95
|
+
android:exported="true"
|
|
96
|
+
android:excludeFromRecents="true">
|
|
97
|
+
<intent-filter>
|
|
98
|
+
<action android:name="android.intent.action.VIEW" />
|
|
99
|
+
<category android:name="android.intent.category.DEFAULT" />
|
|
100
|
+
<category android:name="android.intent.category.BROWSABLE" />
|
|
101
|
+
<data android:scheme="myapp" />
|
|
102
|
+
</intent-filter>
|
|
103
|
+
</activity>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
If a redirect URL has no matching registration, Android auth session creation rejects before opening the browser. The error names `BrowserRedirectActivity` and the required intent-filter shape.
|
|
107
|
+
|
|
108
|
+
See `apps/example/android/app/src/main/AndroidManifest.xml` for a complete working registration using the `nitroexample` scheme.
|
|
109
|
+
|
|
110
|
+
## iOS setup
|
|
111
|
+
|
|
112
|
+
Ordinary browser sessions and custom-scheme authentication sessions need no additional application setup. Universal-link authentication callbacks require the application's normal Associated Domains and universal-link configuration. Ephemeral authentication sessions are controlled with `preferEphemeralSession`; authentication headers require iOS 17.4 or later.
|
|
113
|
+
|
|
114
|
+
## Architecture
|
|
115
|
+
|
|
116
|
+
The public TypeScript API preserves the shape of `expo-web-browser` while the implementation uses a Nitro `HybridObject` boundary.
|
|
117
|
+
|
|
118
|
+
Android authentication depends on two small compatibility seams corresponding to the limited parts of React Native `Linking` and `AppState` used by upstream:
|
|
119
|
+
|
|
120
|
+
- redirect events are emitted by the package-owned `BrowserRedirectActivity`
|
|
121
|
+
- application lifecycle events are observed through NitroUI activity integration
|
|
122
|
+
|
|
123
|
+
These seams are intentionally narrow and replaceable. A future first-class NitroUI linking or lifecycle API can replace them without changing the public browser API or rewriting the ported authentication orchestration.
|
|
124
|
+
|
|
125
|
+
NitroUI colors cross the native boundary in packed `0xRRGGBBAA` form. Platform differences that cannot be represented by a static Nitro method are exposed as rejections or no-op-compatible facade behavior rather than platform-specific exports.
|
|
126
|
+
|
|
127
|
+
## Authentication headers
|
|
128
|
+
|
|
129
|
+
Custom authentication headers are supported on both platforms subject to platform rules:
|
|
130
|
+
|
|
131
|
+
- iOS requires iOS 17.4 or later.
|
|
132
|
+
- Android verifies HTTPS origins through Custom Tabs Digital Asset Links before opening a browser with headers.
|
|
133
|
+
- Android verification can be cancelled by a newer authentication attempt and times out if the browser service does not respond.
|
|
134
|
+
|
|
135
|
+
A real public Digital Asset Links deployment is not required for the local test suite. Low-level orchestration is covered in host tests, while end-to-end redirect coverage uses a controlled local server.
|
|
136
|
+
|
|
137
|
+
## Limitations
|
|
138
|
+
|
|
139
|
+
- Android Custom Tabs cannot generally be closed programmatically. Auth-session cleanup handles that platform limitation internally; direct dismissal can reject.
|
|
140
|
+
- If the application process is destroyed while an authentication session is open, the original JavaScript promise is not resurrected after process death. Native state is scoped to the process and does not leak into a later process.
|
|
141
|
+
- The package excludes Expo's web implementation, React Native runtime glue, Expo config plugins, and Expo-specific build scaffolding.
|
|
142
|
+
- Upstream behavior is preserved where it is observable, but errors are Nitro rejections rather than Expo module exceptions, so exact native error formatting can differ.
|
|
143
|
+
|
|
144
|
+
## Porting baseline
|
|
145
|
+
|
|
146
|
+
- Upstream package: `expo-web-browser@58.1.0`
|
|
147
|
+
- Upstream tag: `expo-web-browser@58.1.0`
|
|
148
|
+
- Upstream revision: `328760b60ba9c0bb82eb75b6e492a7702b5b0338`
|
|
149
|
+
- Target platforms: iOS 16+ and Android API 26+
|
|
150
|
+
|
|
151
|
+
## Testing
|
|
152
|
+
|
|
153
|
+
Host orchestration tests run with:
|
|
154
|
+
|
|
155
|
+
```sh
|
|
156
|
+
bun test
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
End-to-end device tests live in `apps/example/__tests__` and use the real native implementation. The example starts a controlled local redirect server on port 9876 during harness runs, avoiding third-party network dependencies. Run them with:
|
|
160
|
+
|
|
161
|
+
```sh
|
|
162
|
+
bun run test:ios
|
|
163
|
+
bun run test:android
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Some platform cancellation paths require user interaction with the system browser and therefore cannot be fully automated inside an in-process harness. Android covers controlled redirect completion end-to-end; that auth flow is also the device-level ordinary browser launch coverage. Standalone ordinary-browser opening, repeated redirect completion, and user-driven cancellation remain host-test or manual-device coverage because Android Custom Tabs cannot be closed programmatically and Chrome can retain or throttle consecutive automatic navigations. iOS covers programmatic auth dismissal end-to-end; visual redirect completion for `ASWebAuthenticationSession` remains a manual device check because the system authentication browser does not reliably load the loopback test server in the in-process harness. On a fresh Android emulator, complete Chrome's first-run interstitial before running browser harness tests.
|
|
167
|
+
|
|
168
|
+
## Attribution
|
|
169
|
+
|
|
170
|
+
Substantial portions are adapted from Expo's MIT-licensed `expo-web-browser` package. Copyright notices are retained in the repository license and adapted source files.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
package com.margelo.nitro.webbrowser
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import android.os.Build
|
|
6
|
+
import android.os.Bundle
|
|
7
|
+
import androidx.browser.customtabs.CustomTabsIntent
|
|
8
|
+
import androidx.core.net.toUri
|
|
9
|
+
import java.lang.ref.WeakReference
|
|
10
|
+
|
|
11
|
+
class BrowserProxyActivity : Activity() {
|
|
12
|
+
companion object {
|
|
13
|
+
const val EXTRA_URL = "com.margelo.nitro.webbrowser.EXTRA_URL"
|
|
14
|
+
const val EXTRA_CUSTOM_TABS_INTENT_DATA = "com.margelo.nitro.webbrowser.EXTRA_CUSTOM_TABS_INTENT_DATA"
|
|
15
|
+
|
|
16
|
+
var instance: WeakReference<BrowserProxyActivity> = WeakReference(null)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
private var hasLaunchedCustomTab = false
|
|
20
|
+
private var wasPaused = false
|
|
21
|
+
|
|
22
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
23
|
+
super.onCreate(savedInstanceState)
|
|
24
|
+
|
|
25
|
+
if (savedInstanceState != null) {
|
|
26
|
+
return
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
val url = intent.getStringExtra(EXTRA_URL)
|
|
30
|
+
val customTabsIntentData: Intent? = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
31
|
+
intent.getParcelableExtra(EXTRA_CUSTOM_TABS_INTENT_DATA, Intent::class.java)
|
|
32
|
+
} else {
|
|
33
|
+
@Suppress("DEPRECATION")
|
|
34
|
+
intent.getParcelableExtra(EXTRA_CUSTOM_TABS_INTENT_DATA)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (url == null || customTabsIntentData == null) {
|
|
38
|
+
finish()
|
|
39
|
+
return
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
val customTabsIntent = CustomTabsIntent.Builder().build()
|
|
43
|
+
customTabsIntentData.extras?.let { customTabsIntent.intent.putExtras(it) }
|
|
44
|
+
customTabsIntentData.`package`?.let { customTabsIntent.intent.`package` = it }
|
|
45
|
+
customTabsIntent.launchUrl(this, url.toUri())
|
|
46
|
+
|
|
47
|
+
instance = WeakReference(this)
|
|
48
|
+
hasLaunchedCustomTab = true
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
override fun onResume() {
|
|
52
|
+
super.onResume()
|
|
53
|
+
if (hasLaunchedCustomTab && wasPaused) {
|
|
54
|
+
returnToMainApp()
|
|
55
|
+
finish()
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
override fun onPause() {
|
|
60
|
+
super.onPause()
|
|
61
|
+
wasPaused = true
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private fun returnToMainApp() {
|
|
65
|
+
val launchIntent = packageManager.getLaunchIntentForPackage(packageName)
|
|
66
|
+
if (launchIntent != null) {
|
|
67
|
+
launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
|
68
|
+
startActivity(launchIntent)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
override fun onSaveInstanceState(outState: Bundle) {
|
|
73
|
+
super.onSaveInstanceState(outState)
|
|
74
|
+
outState.putBoolean("hasLaunchedCustomTab", hasLaunchedCustomTab)
|
|
75
|
+
outState.putBoolean("wasPaused", wasPaused)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
|
|
79
|
+
super.onRestoreInstanceState(savedInstanceState)
|
|
80
|
+
hasLaunchedCustomTab = savedInstanceState.getBoolean("hasLaunchedCustomTab", false)
|
|
81
|
+
wasPaused = savedInstanceState.getBoolean("wasPaused", false)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.margelo.nitro.webbrowser
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import android.os.Bundle
|
|
6
|
+
|
|
7
|
+
class BrowserRedirectActivity : Activity() {
|
|
8
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
9
|
+
super.onCreate(savedInstanceState)
|
|
10
|
+
if (savedInstanceState == null) {
|
|
11
|
+
intent.dataString?.let { HybridWebBrowser.emitRedirectUrl(it) }
|
|
12
|
+
returnToMainApp()
|
|
13
|
+
}
|
|
14
|
+
finish()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
private fun returnToMainApp() {
|
|
18
|
+
val launchIntent = packageManager.getLaunchIntentForPackage(packageName) ?: return
|
|
19
|
+
launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
|
20
|
+
startActivity(launchIntent)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
package com.margelo.nitro.webbrowser
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import android.content.pm.PackageManager
|
|
6
|
+
import android.content.pm.ResolveInfo
|
|
7
|
+
import androidx.browser.customtabs.CustomTabsClient
|
|
8
|
+
import androidx.browser.customtabs.CustomTabsIntent
|
|
9
|
+
import androidx.browser.customtabs.CustomTabsService
|
|
10
|
+
import androidx.core.net.toUri
|
|
11
|
+
import com.margelo.nitro.renderer.AndroidHost
|
|
12
|
+
|
|
13
|
+
private const val DUMMY_URL = "https://expo.dev"
|
|
14
|
+
|
|
15
|
+
internal class CustomTabsActivitiesHelper {
|
|
16
|
+
fun canResolveIntent(customTabsIntent: CustomTabsIntent): Boolean =
|
|
17
|
+
getResolvingActivities(customTabsIntent).isNotEmpty()
|
|
18
|
+
|
|
19
|
+
val customTabsResolvingActivities: ArrayList<String>
|
|
20
|
+
get() = getResolvingActivities(createDefaultCustomTabsIntent())
|
|
21
|
+
.mapToDistinctArrayList { resolveInfo -> resolveInfo.activityInfo.packageName }
|
|
22
|
+
|
|
23
|
+
val customTabsResolvingServices: ArrayList<String>
|
|
24
|
+
get() = packageManager.queryIntentServices(createDefaultCustomTabsServiceIntent(), 0)
|
|
25
|
+
.mapToDistinctArrayList { resolveInfo -> resolveInfo.serviceInfo.packageName }
|
|
26
|
+
|
|
27
|
+
fun getPreferredCustomTabsResolvingActivity(packages: List<String?>?): String? {
|
|
28
|
+
val resolvedPackages = packages ?: customTabsResolvingActivities
|
|
29
|
+
return CustomTabsClient.getPackageName(currentActivity, resolvedPackages)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
val defaultCustomTabsResolvingActivity: String?
|
|
33
|
+
get() {
|
|
34
|
+
val info = packageManager.resolveActivity(createDefaultCustomTabsIntent().intent, 0)
|
|
35
|
+
return info?.activityInfo?.packageName
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
fun startCustomTabs(tabsIntent: CustomTabsIntent, options: NativeWebBrowserOpenOptions?) {
|
|
39
|
+
val url = tabsIntent.intent.data ?: throw NoUrlProvidedException()
|
|
40
|
+
val shouldCreateTask = options?.createTask ?: true
|
|
41
|
+
val useProxyActivity = options?.useProxyActivity ?: true
|
|
42
|
+
val showInRecents = options?.showInRecents ?: false
|
|
43
|
+
|
|
44
|
+
if (!shouldCreateTask) {
|
|
45
|
+
tabsIntent.launchUrl(currentActivity, url)
|
|
46
|
+
return
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (useProxyActivity) {
|
|
50
|
+
val proxyIntent = Intent(currentActivity, BrowserProxyActivity::class.java).apply {
|
|
51
|
+
putExtra(BrowserProxyActivity.EXTRA_URL, url.toString())
|
|
52
|
+
putExtra(BrowserProxyActivity.EXTRA_CUSTOM_TABS_INTENT_DATA, tabsIntent.intent)
|
|
53
|
+
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
54
|
+
}
|
|
55
|
+
currentActivity.startActivity(proxyIntent)
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
tabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
60
|
+
if (!showInRecents) {
|
|
61
|
+
tabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
|
|
62
|
+
tabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY)
|
|
63
|
+
}
|
|
64
|
+
tabsIntent.launchUrl(currentActivity, url)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private fun getResolvingActivities(customTabsIntent: CustomTabsIntent): List<ResolveInfo> {
|
|
68
|
+
return packageManager.queryIntentActivities(customTabsIntent.intent, 0)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private val packageManager: PackageManager
|
|
72
|
+
get() = currentActivity.packageManager ?: throw PackageManagerNotFoundException()
|
|
73
|
+
|
|
74
|
+
private val currentActivity: Activity
|
|
75
|
+
get() = AndroidHost.activity
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private inline fun <T, R> Collection<T>.mapToDistinctArrayList(mapper: (T) -> R): ArrayList<R> {
|
|
79
|
+
val resultSet = LinkedHashSet<R>()
|
|
80
|
+
for (element in this) {
|
|
81
|
+
resultSet.add(mapper.invoke(element))
|
|
82
|
+
}
|
|
83
|
+
return ArrayList(resultSet)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private fun createDefaultCustomTabsIntent(): CustomTabsIntent {
|
|
87
|
+
return CustomTabsIntent.Builder().build().apply {
|
|
88
|
+
intent.data = DUMMY_URL.toUri()
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
private fun createDefaultCustomTabsServiceIntent() = Intent().apply {
|
|
93
|
+
action = CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION
|
|
94
|
+
}
|