|
@@ -1,13 +1,13 @@
|
1
|
1
|
package com.reactnativecommunity.webview.events
|
2
|
2
|
|
3
|
|
-import com.facebook.react.bridge.Arguments
|
|
3
|
+import com.facebook.react.bridge.WritableMap
|
4
|
4
|
import com.facebook.react.uimanager.events.Event
|
5
|
5
|
import com.facebook.react.uimanager.events.RCTEventEmitter
|
6
|
6
|
|
7
|
7
|
/**
|
8
|
8
|
* Event emitted when there is an error in loading.
|
9
|
9
|
*/
|
10
|
|
-class TopMessageEvent(viewId: Int, private val mData: String) : Event<TopMessageEvent>(viewId) {
|
|
10
|
+class TopMessageEvent(viewId: Int, private val mEventData: WritableMap) : Event<TopMessageEvent>(viewId) {
|
11
|
11
|
companion object {
|
12
|
12
|
const val EVENT_NAME = "topMessage"
|
13
|
13
|
}
|
|
@@ -19,8 +19,6 @@ class TopMessageEvent(viewId: Int, private val mData: String) : Event<TopMessage
|
19
|
19
|
override fun getCoalescingKey(): Short = 0
|
20
|
20
|
|
21
|
21
|
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
22
|
|
- val data = Arguments.createMap()
|
23
|
|
- data.putString("data", mData)
|
24
|
|
- rctEventEmitter.receiveEvent(viewTag, EVENT_NAME, data)
|
|
22
|
+ rctEventEmitter.receiveEvent(viewTag, EVENT_NAME, mEventData)
|
25
|
23
|
}
|
26
|
24
|
}
|