nitro-web-browser 0.0.0-stage → 0.1.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.
- package/LICENSE +27 -0
- package/Package.swift +126 -0
- package/README.md +167 -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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNativeWebBrowserPresentationStyle.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#include <stdexcept>
|
|
13
|
+
|
|
14
|
+
namespace margelo::nitro::webbrowser {
|
|
15
|
+
|
|
16
|
+
namespace jni = facebook::jni;
|
|
17
|
+
|
|
18
|
+
/** JNI access to the Kotlin enum NativeWebBrowserPresentationStyle. */
|
|
19
|
+
struct JNativeWebBrowserPresentationStyle final : public jni::JavaClass<JNativeWebBrowserPresentationStyle> {
|
|
20
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/webbrowser/NativeWebBrowserPresentationStyle;";
|
|
21
|
+
|
|
22
|
+
int32_t value() const {
|
|
23
|
+
static const auto field = javaClassStatic()->getField<jint>("value");
|
|
24
|
+
return getFieldValue(field);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static jni::local_ref<JNativeWebBrowserPresentationStyle> fromValue(int32_t value) {
|
|
28
|
+
return jni::make_local(borrowedFromValue(value));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static jni::alias_ref<JNativeWebBrowserPresentationStyle> borrowedFromValue(int32_t value) {
|
|
32
|
+
static const auto clazz = javaClassStatic();
|
|
33
|
+
switch (value) {
|
|
34
|
+
case 0: {
|
|
35
|
+
static const auto field_FULLSCREEN = clazz->getStaticField<JNativeWebBrowserPresentationStyle>("FULLSCREEN");
|
|
36
|
+
static const auto instance_FULLSCREEN = jni::make_global(clazz->getStaticFieldValue(field_FULLSCREEN));
|
|
37
|
+
return instance_FULLSCREEN;
|
|
38
|
+
}
|
|
39
|
+
case 1: {
|
|
40
|
+
static const auto field_PAGESHEET = clazz->getStaticField<JNativeWebBrowserPresentationStyle>("PAGESHEET");
|
|
41
|
+
static const auto instance_PAGESHEET = jni::make_global(clazz->getStaticFieldValue(field_PAGESHEET));
|
|
42
|
+
return instance_PAGESHEET;
|
|
43
|
+
}
|
|
44
|
+
case 2: {
|
|
45
|
+
static const auto field_FORMSHEET = clazz->getStaticField<JNativeWebBrowserPresentationStyle>("FORMSHEET");
|
|
46
|
+
static const auto instance_FORMSHEET = jni::make_global(clazz->getStaticFieldValue(field_FORMSHEET));
|
|
47
|
+
return instance_FORMSHEET;
|
|
48
|
+
}
|
|
49
|
+
case 3: {
|
|
50
|
+
static const auto field_CURRENTCONTEXT = clazz->getStaticField<JNativeWebBrowserPresentationStyle>("CURRENTCONTEXT");
|
|
51
|
+
static const auto instance_CURRENTCONTEXT = jni::make_global(clazz->getStaticFieldValue(field_CURRENTCONTEXT));
|
|
52
|
+
return instance_CURRENTCONTEXT;
|
|
53
|
+
}
|
|
54
|
+
case 4: {
|
|
55
|
+
static const auto field_OVERFULLSCREEN = clazz->getStaticField<JNativeWebBrowserPresentationStyle>("OVERFULLSCREEN");
|
|
56
|
+
static const auto instance_OVERFULLSCREEN = jni::make_global(clazz->getStaticFieldValue(field_OVERFULLSCREEN));
|
|
57
|
+
return instance_OVERFULLSCREEN;
|
|
58
|
+
}
|
|
59
|
+
case 5: {
|
|
60
|
+
static const auto field_OVERCURRENTCONTEXT = clazz->getStaticField<JNativeWebBrowserPresentationStyle>("OVERCURRENTCONTEXT");
|
|
61
|
+
static const auto instance_OVERCURRENTCONTEXT = jni::make_global(clazz->getStaticFieldValue(field_OVERCURRENTCONTEXT));
|
|
62
|
+
return instance_OVERCURRENTCONTEXT;
|
|
63
|
+
}
|
|
64
|
+
case 6: {
|
|
65
|
+
static const auto field_POPOVER = clazz->getStaticField<JNativeWebBrowserPresentationStyle>("POPOVER");
|
|
66
|
+
static const auto instance_POPOVER = jni::make_global(clazz->getStaticFieldValue(field_POPOVER));
|
|
67
|
+
return instance_POPOVER;
|
|
68
|
+
}
|
|
69
|
+
case 7: {
|
|
70
|
+
static const auto field_AUTOMATIC = clazz->getStaticField<JNativeWebBrowserPresentationStyle>("AUTOMATIC");
|
|
71
|
+
static const auto instance_AUTOMATIC = jni::make_global(clazz->getStaticFieldValue(field_AUTOMATIC));
|
|
72
|
+
return instance_AUTOMATIC;
|
|
73
|
+
}
|
|
74
|
+
default: [[unlikely]]
|
|
75
|
+
throw std::invalid_argument("Invalid NativeWebBrowserPresentationStyle value: " + std::to_string(value));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro::webbrowser
|
|
81
|
+
|
|
82
|
+
namespace margelo::nitro {
|
|
83
|
+
|
|
84
|
+
namespace jni = facebook::jni;
|
|
85
|
+
namespace jsi = facebook::jsi;
|
|
86
|
+
|
|
87
|
+
template <>
|
|
88
|
+
struct JSIConverter<jni::local_ref<margelo::nitro::webbrowser::JNativeWebBrowserPresentationStyle>> {
|
|
89
|
+
static jni::local_ref<margelo::nitro::webbrowser::JNativeWebBrowserPresentationStyle> fromJSI(jsi::Runtime& runtime, const jsi::Value& value);
|
|
90
|
+
static jsi::Value toJSI(jsi::Runtime& runtime, jni::alias_ref<margelo::nitro::webbrowser::JNativeWebBrowserPresentationStyle> value);
|
|
91
|
+
static bool canConvert(jsi::Runtime& runtime, const jsi::Value& value);
|
|
92
|
+
protected:
|
|
93
|
+
static int32_t valueFromJSI(jsi::Runtime& runtime, const jsi::Value& value);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// These aliases borrow the immutable singleton owners in borrowedFromValue().
|
|
97
|
+
template <>
|
|
98
|
+
struct JSIConverter<jni::alias_ref<margelo::nitro::webbrowser::JNativeWebBrowserPresentationStyle>> : JSIConverter<jni::local_ref<margelo::nitro::webbrowser::JNativeWebBrowserPresentationStyle>> {
|
|
99
|
+
static jni::alias_ref<margelo::nitro::webbrowser::JNativeWebBrowserPresentationStyle> fromJSI(jsi::Runtime& runtime, const jsi::Value& value);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
} // namespace margelo::nitro
|
package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserResult.hpp
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNativeWebBrowserResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#include <NitroWebBrowser/private/JNativeWebBrowserResultType.hpp>
|
|
13
|
+
|
|
14
|
+
namespace margelo::nitro::webbrowser {
|
|
15
|
+
|
|
16
|
+
namespace jni = facebook::jni;
|
|
17
|
+
|
|
18
|
+
/** JNI access to the Kotlin data class NativeWebBrowserResult. */
|
|
19
|
+
struct JNativeWebBrowserResult final : public jni::JavaClass<JNativeWebBrowserResult> {
|
|
20
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/webbrowser/NativeWebBrowserResult;";
|
|
21
|
+
|
|
22
|
+
static jni::local_ref<JNativeWebBrowserResult> create(jni::alias_ref<JNativeWebBrowserResultType> type) {
|
|
23
|
+
static const auto clazz = javaClassStatic();
|
|
24
|
+
static const auto create = clazz->getStaticMethod<JNativeWebBrowserResult(jni::alias_ref<JNativeWebBrowserResultType>)>("fromCpp");
|
|
25
|
+
return create(clazz, type);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
jni::local_ref<JNativeWebBrowserResultType> getType() const {
|
|
29
|
+
static const auto field = javaClassStatic()->getField<JNativeWebBrowserResultType>("type");
|
|
30
|
+
return getFieldValue(field);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
} // namespace margelo::nitro::webbrowser
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro {
|
|
37
|
+
|
|
38
|
+
namespace jni = facebook::jni;
|
|
39
|
+
namespace jsi = facebook::jsi;
|
|
40
|
+
|
|
41
|
+
template <>
|
|
42
|
+
struct JSIConverter<jni::local_ref<margelo::nitro::webbrowser::JNativeWebBrowserResult>> {
|
|
43
|
+
static jni::local_ref<margelo::nitro::webbrowser::JNativeWebBrowserResult> fromJSI(jsi::Runtime& runtime, const jsi::Value& value);
|
|
44
|
+
static jsi::Value toJSI(jsi::Runtime& runtime, jni::alias_ref<margelo::nitro::webbrowser::JNativeWebBrowserResult> value);
|
|
45
|
+
static bool canConvert(jsi::Runtime& runtime, const jsi::Value& value);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNativeWebBrowserResultType.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#include <stdexcept>
|
|
13
|
+
|
|
14
|
+
namespace margelo::nitro::webbrowser {
|
|
15
|
+
|
|
16
|
+
namespace jni = facebook::jni;
|
|
17
|
+
|
|
18
|
+
/** JNI access to the Kotlin enum NativeWebBrowserResultType. */
|
|
19
|
+
struct JNativeWebBrowserResultType final : public jni::JavaClass<JNativeWebBrowserResultType> {
|
|
20
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/webbrowser/NativeWebBrowserResultType;";
|
|
21
|
+
|
|
22
|
+
int32_t value() const {
|
|
23
|
+
static const auto field = javaClassStatic()->getField<jint>("value");
|
|
24
|
+
return getFieldValue(field);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static jni::local_ref<JNativeWebBrowserResultType> fromValue(int32_t value) {
|
|
28
|
+
return jni::make_local(borrowedFromValue(value));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static jni::alias_ref<JNativeWebBrowserResultType> borrowedFromValue(int32_t value) {
|
|
32
|
+
static const auto clazz = javaClassStatic();
|
|
33
|
+
switch (value) {
|
|
34
|
+
case 0: {
|
|
35
|
+
static const auto field_CANCEL = clazz->getStaticField<JNativeWebBrowserResultType>("CANCEL");
|
|
36
|
+
static const auto instance_CANCEL = jni::make_global(clazz->getStaticFieldValue(field_CANCEL));
|
|
37
|
+
return instance_CANCEL;
|
|
38
|
+
}
|
|
39
|
+
case 1: {
|
|
40
|
+
static const auto field_DISMISS = clazz->getStaticField<JNativeWebBrowserResultType>("DISMISS");
|
|
41
|
+
static const auto instance_DISMISS = jni::make_global(clazz->getStaticFieldValue(field_DISMISS));
|
|
42
|
+
return instance_DISMISS;
|
|
43
|
+
}
|
|
44
|
+
case 2: {
|
|
45
|
+
static const auto field_OPENED = clazz->getStaticField<JNativeWebBrowserResultType>("OPENED");
|
|
46
|
+
static const auto instance_OPENED = jni::make_global(clazz->getStaticFieldValue(field_OPENED));
|
|
47
|
+
return instance_OPENED;
|
|
48
|
+
}
|
|
49
|
+
case 3: {
|
|
50
|
+
static const auto field_LOCKED = clazz->getStaticField<JNativeWebBrowserResultType>("LOCKED");
|
|
51
|
+
static const auto instance_LOCKED = jni::make_global(clazz->getStaticFieldValue(field_LOCKED));
|
|
52
|
+
return instance_LOCKED;
|
|
53
|
+
}
|
|
54
|
+
default: [[unlikely]]
|
|
55
|
+
throw std::invalid_argument("Invalid NativeWebBrowserResultType value: " + std::to_string(value));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
} // namespace margelo::nitro::webbrowser
|
|
61
|
+
|
|
62
|
+
namespace margelo::nitro {
|
|
63
|
+
|
|
64
|
+
namespace jni = facebook::jni;
|
|
65
|
+
namespace jsi = facebook::jsi;
|
|
66
|
+
|
|
67
|
+
template <>
|
|
68
|
+
struct JSIConverter<jni::local_ref<margelo::nitro::webbrowser::JNativeWebBrowserResultType>> {
|
|
69
|
+
static jni::local_ref<margelo::nitro::webbrowser::JNativeWebBrowserResultType> fromJSI(jsi::Runtime& runtime, const jsi::Value& value);
|
|
70
|
+
static jsi::Value toJSI(jsi::Runtime& runtime, jni::alias_ref<margelo::nitro::webbrowser::JNativeWebBrowserResultType> value);
|
|
71
|
+
static bool canConvert(jsi::Runtime& runtime, const jsi::Value& value);
|
|
72
|
+
protected:
|
|
73
|
+
static int32_t valueFromJSI(jsi::Runtime& runtime, const jsi::Value& value);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// These aliases borrow the immutable singleton owners in borrowedFromValue().
|
|
77
|
+
template <>
|
|
78
|
+
struct JSIConverter<jni::alias_ref<margelo::nitro::webbrowser::JNativeWebBrowserResultType>> : JSIConverter<jni::local_ref<margelo::nitro::webbrowser::JNativeWebBrowserResultType>> {
|
|
79
|
+
static jni::alias_ref<margelo::nitro::webbrowser::JNativeWebBrowserResultType> fromJSI(jsi::Runtime& runtime, const jsi::Value& value);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroWebBrowserOnLoad.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::webbrowser {
|
|
11
|
+
// Call inside facebook::jni::initialize() from JNI_OnLoad.
|
|
12
|
+
void registerAllNatives();
|
|
13
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Callback_void.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.Callback
|
|
14
|
+
import com.margelo.nitro.core.Promise
|
|
15
|
+
import com.margelo.nitro.core.CxxCallback
|
|
16
|
+
import com.margelo.nitro.core.callSync
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The JNI representation of `Callback<() -> Unit>`, for the JavaScript callback `() => void`.
|
|
20
|
+
* It holds a C++ `Callback<...>`, which calls either a JS function or a native function.
|
|
21
|
+
* Use `Callback<() -> Unit>` instead of this class in your code.
|
|
22
|
+
*/
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
@Suppress(
|
|
26
|
+
"KotlinJniMissingFunction", "unused",
|
|
27
|
+
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
28
|
+
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
29
|
+
"PARAMETER_NAME_CHANGED_ON_OVERRIDE",
|
|
30
|
+
)
|
|
31
|
+
class Callback_void @DoNotStrip @Keep private constructor(hybridData: HybridData): CxxCallback(hybridData), Callback.Arity0<Unit> {
|
|
32
|
+
override fun callSync(): Unit {
|
|
33
|
+
callSync_cxx()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
override fun callAsync(): Promise<Unit> {
|
|
37
|
+
return callAsync_cxx()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
override fun callAndForget(): Unit {
|
|
41
|
+
callAndForget_cxx()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Lets C++ call a callback implemented in Kotlin through a JNI entry point.
|
|
46
|
+
* C++ creates it when such a callback crosses JNI.
|
|
47
|
+
*/
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
private class Function_cxx(private val callback: Callback<() -> Unit>) {
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
fun call(): Unit {
|
|
54
|
+
this.callback.callSync()
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@DoNotStrip
|
|
59
|
+
@Keep
|
|
60
|
+
private external fun callSync_cxx(): Unit
|
|
61
|
+
|
|
62
|
+
@DoNotStrip
|
|
63
|
+
@Keep
|
|
64
|
+
private external fun callAsync_cxx(): Promise<Unit>
|
|
65
|
+
|
|
66
|
+
@DoNotStrip
|
|
67
|
+
@Keep
|
|
68
|
+
private external fun callAndForget_cxx(): Unit
|
|
69
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Callback_void_NativeAppStateStatus.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.Callback
|
|
14
|
+
import com.margelo.nitro.core.Promise
|
|
15
|
+
import com.margelo.nitro.core.CxxCallback
|
|
16
|
+
import com.margelo.nitro.core.callSync
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The JNI representation of `Callback<(state: NativeAppStateStatus) -> Unit>`, for the JavaScript callback `(state: enum) => void`.
|
|
20
|
+
* It holds a C++ `Callback<...>`, which calls either a JS function or a native function.
|
|
21
|
+
* Use `Callback<(state: NativeAppStateStatus) -> Unit>` instead of this class in your code.
|
|
22
|
+
*/
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
@Suppress(
|
|
26
|
+
"KotlinJniMissingFunction", "unused",
|
|
27
|
+
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
28
|
+
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
29
|
+
"PARAMETER_NAME_CHANGED_ON_OVERRIDE",
|
|
30
|
+
)
|
|
31
|
+
class Callback_void_NativeAppStateStatus @DoNotStrip @Keep private constructor(hybridData: HybridData): CxxCallback(hybridData), Callback.Arity1<NativeAppStateStatus, Unit> {
|
|
32
|
+
override fun callSync(state: NativeAppStateStatus): Unit {
|
|
33
|
+
callSync_cxx(state)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
override fun callAsync(state: NativeAppStateStatus): Promise<Unit> {
|
|
37
|
+
return callAsync_cxx(state)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
override fun callAndForget(state: NativeAppStateStatus): Unit {
|
|
41
|
+
callAndForget_cxx(state)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Lets C++ call a callback implemented in Kotlin through a JNI entry point.
|
|
46
|
+
* C++ creates it when such a callback crosses JNI.
|
|
47
|
+
*/
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
private class Function_cxx(private val callback: Callback<(state: NativeAppStateStatus) -> Unit>) {
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
fun call(state: NativeAppStateStatus): Unit {
|
|
54
|
+
this.callback.callSync(state)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@DoNotStrip
|
|
59
|
+
@Keep
|
|
60
|
+
private external fun callSync_cxx(state: NativeAppStateStatus): Unit
|
|
61
|
+
|
|
62
|
+
@DoNotStrip
|
|
63
|
+
@Keep
|
|
64
|
+
private external fun callAsync_cxx(state: NativeAppStateStatus): Promise<Unit>
|
|
65
|
+
|
|
66
|
+
@DoNotStrip
|
|
67
|
+
@Keep
|
|
68
|
+
private external fun callAndForget_cxx(state: NativeAppStateStatus): Unit
|
|
69
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Callback_void_NativeRedirectEvent.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.Callback
|
|
14
|
+
import com.margelo.nitro.core.Promise
|
|
15
|
+
import com.margelo.nitro.core.CxxCallback
|
|
16
|
+
import com.margelo.nitro.core.callSync
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The JNI representation of `Callback<(event: NativeRedirectEvent) -> Unit>`, for the JavaScript callback `(event: struct) => void`.
|
|
20
|
+
* It holds a C++ `Callback<...>`, which calls either a JS function or a native function.
|
|
21
|
+
* Use `Callback<(event: NativeRedirectEvent) -> Unit>` instead of this class in your code.
|
|
22
|
+
*/
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
@Suppress(
|
|
26
|
+
"KotlinJniMissingFunction", "unused",
|
|
27
|
+
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
28
|
+
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
29
|
+
"PARAMETER_NAME_CHANGED_ON_OVERRIDE",
|
|
30
|
+
)
|
|
31
|
+
class Callback_void_NativeRedirectEvent @DoNotStrip @Keep private constructor(hybridData: HybridData): CxxCallback(hybridData), Callback.Arity1<NativeRedirectEvent, Unit> {
|
|
32
|
+
override fun callSync(event: NativeRedirectEvent): Unit {
|
|
33
|
+
callSync_cxx(event)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
override fun callAsync(event: NativeRedirectEvent): Promise<Unit> {
|
|
37
|
+
return callAsync_cxx(event)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
override fun callAndForget(event: NativeRedirectEvent): Unit {
|
|
41
|
+
callAndForget_cxx(event)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Lets C++ call a callback implemented in Kotlin through a JNI entry point.
|
|
46
|
+
* C++ creates it when such a callback crosses JNI.
|
|
47
|
+
*/
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
private class Function_cxx(private val callback: Callback<(event: NativeRedirectEvent) -> Unit>) {
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
fun call(event: NativeRedirectEvent): Unit {
|
|
54
|
+
this.callback.callSync(event)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@DoNotStrip
|
|
59
|
+
@Keep
|
|
60
|
+
private external fun callSync_cxx(event: NativeRedirectEvent): Unit
|
|
61
|
+
|
|
62
|
+
@DoNotStrip
|
|
63
|
+
@Keep
|
|
64
|
+
private external fun callAsync_cxx(event: NativeRedirectEvent): Promise<Unit>
|
|
65
|
+
|
|
66
|
+
@DoNotStrip
|
|
67
|
+
@Keep
|
|
68
|
+
private external fun callAndForget_cxx(event: NativeRedirectEvent): Unit
|
|
69
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/HybridWebBrowserSpec.kt
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridWebBrowserSpec.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
14
|
+
import com.margelo.nitro.core.Promise
|
|
15
|
+
import com.margelo.nitro.core.Callback
|
|
16
|
+
import com.margelo.nitro.webbrowser.HybridWebBrowser
|
|
17
|
+
import com.margelo.nitro.core.HybridObject
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Kotlin class representing the WebBrowser HybridObject.
|
|
21
|
+
* Implement this abstract class to create Kotlin-based instances of WebBrowser.
|
|
22
|
+
*/
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
@Suppress(
|
|
26
|
+
"KotlinJniMissingFunction", "unused",
|
|
27
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
28
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
29
|
+
)
|
|
30
|
+
abstract class HybridWebBrowserSpec: HybridObject() {
|
|
31
|
+
// Properties
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
// Methods
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
// Default implementation of `HybridObject.toString()`
|
|
38
|
+
override fun toString(): String {
|
|
39
|
+
return "[HybridObject WebBrowser]"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// C++ backing class
|
|
43
|
+
@DoNotStrip
|
|
44
|
+
@Keep
|
|
45
|
+
protected open class CxxPart(javaPart: HybridWebBrowserSpec): HybridObject.CxxPart(javaPart) {
|
|
46
|
+
// C++ JHybridWebBrowserSpec::CxxPart::initHybrid(...)
|
|
47
|
+
@FastNative
|
|
48
|
+
external override fun initHybrid(): HybridData
|
|
49
|
+
|
|
50
|
+
companion object {
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
@JvmField
|
|
54
|
+
val implementationClass_cxx: Class<out HybridWebBrowserSpec> = HybridWebBrowser::class.java
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
override fun createCxxPart(): CxxPart {
|
|
58
|
+
return CxxPart(this)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface Companion {
|
|
62
|
+
// Static Properties
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
// Static Methods
|
|
66
|
+
fun warmUpAsync(browserPackage: String?): Promise<NativeServiceActionResult>
|
|
67
|
+
|
|
68
|
+
fun coolDownAsync(browserPackage: String?): Promise<NativeServiceActionResult>
|
|
69
|
+
|
|
70
|
+
fun mayInitWithUrlAsync(url: String, browserPackage: String?): Promise<NativeServiceActionResult>
|
|
71
|
+
|
|
72
|
+
fun getCustomTabsSupportingBrowsersAsync(): Promise<NativeWebBrowserCustomTabsResults>
|
|
73
|
+
|
|
74
|
+
fun openBrowserAsync(url: String, options: NativeWebBrowserOpenOptions?): Promise<NativeWebBrowserResult>
|
|
75
|
+
|
|
76
|
+
fun dismissBrowser(): Promise<NativeWebBrowserResult>
|
|
77
|
+
|
|
78
|
+
fun openAuthSessionAsync(authUrl: String, redirectUrl: String?, options: NativeWebBrowserOpenOptions?): Promise<NativeWebBrowserAuthSessionResult>
|
|
79
|
+
|
|
80
|
+
fun dismissAuthSession(): Unit
|
|
81
|
+
|
|
82
|
+
fun cancelPendingBrowserOpen(): Promise<Unit>
|
|
83
|
+
|
|
84
|
+
fun getCurrentAppState(): NativeAppStateStatus?
|
|
85
|
+
|
|
86
|
+
fun addOnAppStateChangedListener(listener: Callback<(state: NativeAppStateStatus) -> Unit>): ListenerSubscription
|
|
87
|
+
|
|
88
|
+
fun isRedirectUrlRegistered(url: String): Boolean
|
|
89
|
+
|
|
90
|
+
fun addOnRedirectUrlListener(listener: Callback<(event: NativeRedirectEvent) -> Unit>): ListenerSubscription
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
protected companion object Bridge {
|
|
94
|
+
protected const val TAG = "HybridWebBrowserSpec"
|
|
95
|
+
|
|
96
|
+
private val implementationCompanion: Companion
|
|
97
|
+
get() = HybridWebBrowser
|
|
98
|
+
|
|
99
|
+
// Static methods
|
|
100
|
+
@JvmStatic
|
|
101
|
+
@DoNotStrip
|
|
102
|
+
@Keep
|
|
103
|
+
private fun warmUpAsync_cxx(browserPackage: String?): Promise<NativeServiceActionResult> {
|
|
104
|
+
return HybridWebBrowser.warmUpAsync(browserPackage)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@JvmStatic
|
|
108
|
+
@DoNotStrip
|
|
109
|
+
@Keep
|
|
110
|
+
private fun coolDownAsync_cxx(browserPackage: String?): Promise<NativeServiceActionResult> {
|
|
111
|
+
return HybridWebBrowser.coolDownAsync(browserPackage)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@JvmStatic
|
|
115
|
+
@DoNotStrip
|
|
116
|
+
@Keep
|
|
117
|
+
private fun mayInitWithUrlAsync_cxx(url: String, browserPackage: String?): Promise<NativeServiceActionResult> {
|
|
118
|
+
return HybridWebBrowser.mayInitWithUrlAsync(url, browserPackage)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@JvmStatic
|
|
122
|
+
@DoNotStrip
|
|
123
|
+
@Keep
|
|
124
|
+
private fun getCustomTabsSupportingBrowsersAsync_cxx(): Promise<NativeWebBrowserCustomTabsResults> {
|
|
125
|
+
return HybridWebBrowser.getCustomTabsSupportingBrowsersAsync()
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@JvmStatic
|
|
129
|
+
@DoNotStrip
|
|
130
|
+
@Keep
|
|
131
|
+
private fun openBrowserAsync_cxx(url: String, options: NativeWebBrowserOpenOptions?): Promise<NativeWebBrowserResult> {
|
|
132
|
+
return HybridWebBrowser.openBrowserAsync(url, options)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@JvmStatic
|
|
136
|
+
@DoNotStrip
|
|
137
|
+
@Keep
|
|
138
|
+
private fun dismissBrowser_cxx(): Promise<NativeWebBrowserResult> {
|
|
139
|
+
return HybridWebBrowser.dismissBrowser()
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@JvmStatic
|
|
143
|
+
@DoNotStrip
|
|
144
|
+
@Keep
|
|
145
|
+
private fun openAuthSessionAsync_cxx(authUrl: String, redirectUrl: String?, options: NativeWebBrowserOpenOptions?): Promise<NativeWebBrowserAuthSessionResult> {
|
|
146
|
+
return HybridWebBrowser.openAuthSessionAsync(authUrl, redirectUrl, options)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@JvmStatic
|
|
150
|
+
@DoNotStrip
|
|
151
|
+
@Keep
|
|
152
|
+
private fun dismissAuthSession_cxx(): Unit {
|
|
153
|
+
HybridWebBrowser.dismissAuthSession()
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@JvmStatic
|
|
157
|
+
@DoNotStrip
|
|
158
|
+
@Keep
|
|
159
|
+
private fun cancelPendingBrowserOpen_cxx(): Promise<Unit> {
|
|
160
|
+
return HybridWebBrowser.cancelPendingBrowserOpen()
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@JvmStatic
|
|
164
|
+
@DoNotStrip
|
|
165
|
+
@Keep
|
|
166
|
+
private fun getCurrentAppState_cxx(): NativeAppStateStatus? {
|
|
167
|
+
return HybridWebBrowser.getCurrentAppState()
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@JvmStatic
|
|
171
|
+
@DoNotStrip
|
|
172
|
+
@Keep
|
|
173
|
+
private fun addOnAppStateChangedListener_cxx(listener: Callback<(state: NativeAppStateStatus) -> Unit>): ListenerSubscription {
|
|
174
|
+
return HybridWebBrowser.addOnAppStateChangedListener(listener)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@JvmStatic
|
|
178
|
+
@DoNotStrip
|
|
179
|
+
@Keep
|
|
180
|
+
private fun isRedirectUrlRegistered_cxx(url: String): Boolean {
|
|
181
|
+
return HybridWebBrowser.isRedirectUrlRegistered(url)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@JvmStatic
|
|
185
|
+
@DoNotStrip
|
|
186
|
+
@Keep
|
|
187
|
+
private fun addOnRedirectUrlListener_cxx(listener: Callback<(event: NativeRedirectEvent) -> Unit>): ListenerSubscription {
|
|
188
|
+
return HybridWebBrowser.addOnRedirectUrlListener(listener)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|