Skip to content

Commit 55bdf61

Browse files
committed
[MOBILE-5470] Namespace view events
1 parent 206df37 commit 55bdf61

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

android/src/main/java/com/urbanairship/reactnative/ReactMessageView.kt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,21 +181,16 @@ class ReactMessageView(context: Context) : FrameLayout(context), LifecycleEventL
181181
}
182182

183183
companion object {
184-
const val EVENT_LOAD_STARTED_REGISTRATION_NAME = "topLoadStarted"
185-
const val EVENT_LOAD_FINISHED_REGISTRATION_NAME = "topLoadFinished"
186-
const val EVENT_LOAD_ERROR_REGISTRATION_NAME = "topLoadError"
187-
const val EVENT_CLOSE_REGISTRATION_NAME = "topClose"
184+
const val EVENT_LOAD_STARTED = "airship_message_view_topLoadStarted"
185+
const val EVENT_LOAD_FINISHED = "airship_message_view_topLoadFinished"
186+
const val EVENT_LOAD_ERROR = "airship_message_view_topLoadError"
187+
const val EVENT_CLOSE = "airship_message_view_topClose"
188188

189189
const val EVENT_LOAD_STARTED_HANDLER_NAME = "onLoadStarted"
190190
const val EVENT_LOAD_FINISHED_HANDLER_NAME = "onLoadFinished"
191191
const val EVENT_LOAD_ERROR_HANDLER_NAME = "onLoadError"
192192
const val EVENT_CLOSE_HANDLER_NAME = "onClose"
193193

194-
const val EVENT_LOAD_STARTED = "loadStarted"
195-
const val EVENT_LOAD_FINISHED = "loadFinished"
196-
const val EVENT_LOAD_ERROR = "loadError"
197-
const val EVENT_CLOSE = "close"
198-
199194
private const val MESSAGE_ID_KEY = "messageId"
200195
private const val RETRYABLE_KEY = "retryable"
201196
private const val ERROR_KEY = "error"

android/src/main/java/com/urbanairship/reactnative/ReactMessageViewManager.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ class ReactMessageViewManager : SimpleViewManager<ReactMessageView>(),
5959

6060
override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any> {
6161
val events = listOf(
62-
ReactMessageView.EVENT_CLOSE_REGISTRATION_NAME to ReactMessageView.EVENT_CLOSE_HANDLER_NAME,
63-
ReactMessageView.EVENT_LOAD_ERROR_REGISTRATION_NAME to ReactMessageView.EVENT_LOAD_ERROR_HANDLER_NAME,
64-
ReactMessageView.EVENT_LOAD_FINISHED_REGISTRATION_NAME to ReactMessageView.EVENT_LOAD_FINISHED_HANDLER_NAME,
65-
ReactMessageView.EVENT_LOAD_STARTED_REGISTRATION_NAME to ReactMessageView.EVENT_LOAD_STARTED_HANDLER_NAME
62+
ReactMessageView.EVENT_CLOSE to ReactMessageView.EVENT_CLOSE_HANDLER_NAME,
63+
ReactMessageView.EVENT_LOAD_ERROR to ReactMessageView.EVENT_LOAD_ERROR_HANDLER_NAME,
64+
ReactMessageView.EVENT_LOAD_FINISHED to ReactMessageView.EVENT_LOAD_FINISHED_HANDLER_NAME,
65+
ReactMessageView.EVENT_LOAD_STARTED to ReactMessageView.EVENT_LOAD_STARTED_HANDLER_NAME
6666
)
6767

6868

src/RNAirshipMessageViewNativeComponent.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ interface NativeProps extends ViewProps {
2727
messageId: string;
2828
onLoadStarted: BubblingEventHandler<
2929
MessageLoadStartedEvent,
30-
'topLoadStarted'
30+
'airship_message_view_topLoadStarted'
3131
>;
3232
onLoadFinished: BubblingEventHandler<
3333
MessageLoadFinishedEvent,
34-
'topLoadFinished'
34+
'airship_message_view_topLoadFinished'
3535
>;
36-
onLoadError: BubblingEventHandler<MessageLoadErrorEvent, 'topLoadError'>;
37-
onClose: BubblingEventHandler<MessageClosedEvent, 'topClose'>;
36+
onLoadError: BubblingEventHandler<MessageLoadErrorEvent, 'airship_message_view_topLoadError'>;
37+
onClose: BubblingEventHandler<MessageClosedEvent, 'airship_message_view_topClose'>;
3838
}
3939

4040
export default codegenNativeComponent<NativeProps>('RNAirshipMessageView') as HostComponent<NativeProps>;

0 commit comments

Comments
 (0)