Skip to content

Commit c803762

Browse files
committed
js: export native event name constant
1 parent 46bb6ee commit c803762

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ class MyComponent extends React.Component {
198198
}
199199
for (let voipPushEvent of events) {
200200
let { name, data } = voipPushEvent;
201-
if (name === 'RNVoipPushRemoteNotificationsRegisteredEvent') {
201+
if (name === VoipPushNotification.RNVoipPushRemoteNotificationsRegisteredEvent) {
202202
this.onVoipPushNotificationRegistered(data);
203-
} else if (name === 'RNVoipPushRemoteNotificationReceivedEvent') {
203+
} else if (name === VoipPushNotification.RNVoipPushRemoteNotificationReceivedEvent) {
204204
this.onVoipPushNotificationiReceived(data);
205205
}
206206
}

index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ const RNVoipPushDidLoadWithEvents = "RNVoipPushDidLoadWithEvents"; // --- 'didLo
1818

1919
export default class RNVoipPushNotification {
2020

21+
static get RNVoipPushRemoteNotificationsRegisteredEvent() {
22+
return RNVoipPushRemoteNotificationsRegisteredEvent;
23+
}
24+
25+
static get RNVoipPushRemoteNotificationReceivedEvent() {
26+
return RNVoipPushRemoteNotificationReceivedEvent;
27+
}
28+
29+
static get RNVoipPushDidLoadWithEvents() {
30+
return RNVoipPushDidLoadWithEvents;
31+
}
32+
2133
/**
2234
* Attaches a listener to remote notification events while the app is running
2335
* in the foreground or the background.

0 commit comments

Comments
 (0)