mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 19:51:10 +00:00
* Manage to build webview using Visual Studio * WebView in content of UserControl * Destructor not needed * Example app tested * Add messagingEnabled prop * WebViewBridge * Message posting * Store bridge as instance variable * Use bridge if messagingEnabled * Free event delegate * PostMessage api uses string message * script.notify() usage removed * Debug log removed * Bridge reference added * Base for web allowed object implemented c++/winrt * Bribge works * "Microsoft.Windows.CppWinRT" version="2.0.200729.8" * Update bridge implementation * version changes * Reference fix * WebView prj builds * yarn lock update * Platfrom version update * NuGet package reference updated * Messaging test added into example app * Typo fix * try_as() to as() calls * WebView.PostMessage() not supported anymore, use injectJavaScript * Fix WebView.postMessage to work using injectJavascript * Eval postMessage fix * postMessage via injectJavascript * Example fixed to handle postMessage call
20 lines
531 B
C++
20 lines
531 B
C++
#include "pch.h"
|
|
#include "WebBridge.h"
|
|
#include "WebBridge.g.cpp"
|
|
|
|
namespace winrt::WebViewBridgeComponent::implementation
|
|
{
|
|
void WebBridge::PostMessage(hstring const& message)
|
|
{
|
|
m_messageEvent(*this, message);
|
|
}
|
|
winrt::event_token WebBridge::MessagePostEvent(Windows::Foundation::EventHandler<hstring> const& handler)
|
|
{
|
|
return m_messageEvent.add(handler);
|
|
}
|
|
void WebBridge::MessagePostEvent(winrt::event_token const& token) noexcept
|
|
{
|
|
m_messageEvent.remove(token);
|
|
}
|
|
}
|