Skip to content

Commit

Permalink
js: export native event name constant
Browse files Browse the repository at this point in the history
  • Loading branch information
zxcpoiu committed Nov 17, 2020
1 parent 46bb6ee commit c803762
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ class MyComponent extends React.Component {
}
for (let voipPushEvent of events) {
let { name, data } = voipPushEvent;
if (name === 'RNVoipPushRemoteNotificationsRegisteredEvent') {
if (name === VoipPushNotification.RNVoipPushRemoteNotificationsRegisteredEvent) {
this.onVoipPushNotificationRegistered(data);
} else if (name === 'RNVoipPushRemoteNotificationReceivedEvent') {
} else if (name === VoipPushNotification.RNVoipPushRemoteNotificationReceivedEvent) {
this.onVoipPushNotificationiReceived(data);
}
}
Expand Down
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ const RNVoipPushDidLoadWithEvents = "RNVoipPushDidLoadWithEvents"; // --- 'didLo

export default class RNVoipPushNotification {

static get RNVoipPushRemoteNotificationsRegisteredEvent() {
return RNVoipPushRemoteNotificationsRegisteredEvent;
}

static get RNVoipPushRemoteNotificationReceivedEvent() {
return RNVoipPushRemoteNotificationReceivedEvent;
}

static get RNVoipPushDidLoadWithEvents() {
return RNVoipPushDidLoadWithEvents;
}

/**
* Attaches a listener to remote notification events while the app is running
* in the foreground or the background.
Expand Down

0 comments on commit c803762

Please sign in to comment.