mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 11:41:08 +00:00
feat(Windows): Windows support! (#1220)
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
#include "pch.h"
|
||||
|
||||
#include "App.h"
|
||||
#include "ReactPackageProvider.h"
|
||||
#include "winrt/ReactNativeWebView.h"
|
||||
|
||||
|
||||
using namespace winrt::WebViewWindows;
|
||||
using namespace winrt::WebViewWindows::implementation;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the singleton application object. This is the first line of
|
||||
/// authored code executed, and as such is the logical equivalent of main() or
|
||||
/// WinMain().
|
||||
/// </summary>
|
||||
App::App() noexcept
|
||||
{
|
||||
MainComponentName(L"example");
|
||||
|
||||
#if BUNDLE
|
||||
JavaScriptBundleFile(L"index.windows");
|
||||
InstanceSettings().UseWebDebugger(false);
|
||||
InstanceSettings().UseLiveReload(false);
|
||||
#else
|
||||
JavaScriptMainModuleName(L"example/index");
|
||||
InstanceSettings().UseWebDebugger(true);
|
||||
InstanceSettings().UseLiveReload(true);
|
||||
#endif
|
||||
|
||||
#if _DEBUG
|
||||
InstanceSettings().EnableDeveloperMenu(true);
|
||||
#else
|
||||
InstanceSettings().EnableDeveloperMenu(false);
|
||||
#endif
|
||||
|
||||
PackageProviders().Append(make<ReactPackageProvider>()); // Includes all modules in this project
|
||||
PackageProviders().Append(winrt::ReactNativeWebView::ReactPackageProvider());
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
// This works around a cpp/winrt bug with composable/aggregable types tracked
|
||||
// by 22116519
|
||||
AddRef();
|
||||
m_inner.as<::IUnknown>()->Release();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user