|
@@ -35,7 +35,7 @@ namespace winrt::ReactNativeWebView::implementation {
|
35
|
35
|
ReactWebView::~ReactWebView()
|
36
|
36
|
{
|
37
|
37
|
if (m_messagingEnabled) {
|
38
|
|
- //m_webBridge.MessagePostedEvent(m_message_token);
|
|
38
|
+ m_webBridge.MessagePostEvent(m_message_token);
|
39
|
39
|
}
|
40
|
40
|
}
|
41
|
41
|
|
|
@@ -86,16 +86,11 @@ namespace winrt::ReactNativeWebView::implementation {
|
86
|
86
|
});
|
87
|
87
|
|
88
|
88
|
if (m_messagingEnabled) {
|
89
|
|
- auto tag = this->GetValue(winrt::FrameworkElement::TagProperty()).as<winrt::IPropertyValue>().GetInt64();
|
90
|
|
- /*
|
91
|
|
- m_webBridge = WebViewBridge::WebBridge(tag);
|
92
|
|
- m_message_token = m_webBridge.MessagePostedEvent([this](hstring const& message) {
|
93
|
|
- this->OnMessagePosted(message);
|
94
|
|
- });
|
95
|
|
- webView.AddWebAllowedObject(L"__REACT_WEB_VIEW_BRIDGE", m_webBridge);
|
96
|
|
- */
|
97
|
|
-
|
98
|
89
|
m_webBridge = WebBridge();
|
|
90
|
+ m_message_token = m_webBridge.MessagePostEvent([this](const auto&, hstring const& message)
|
|
91
|
+ {
|
|
92
|
+ this->OnMessagePosted(message);
|
|
93
|
+ });
|
99
|
94
|
webView.AddWebAllowedObject(L"__REACT_WEB_VIEW_BRIDGE", m_webBridge);
|
100
|
95
|
}
|
101
|
96
|
}
|