import { NativeModules } from 'react-native' ; import OSNotification from '../OSNotification' ; const RNOneSignal = NativeModules . OneSignal ; export default class NotificationReceivedEvent { private notification : OSNotification ; constructor ( receivedEvent ) { this . notification = new OSNotification ( receivedEvent ) ; } complete ( notification ? ) { if ( ! notification ) { RNOneSignal . completeNotificationEvent ( this . notification . notificationId , false ) ; return ; } RNOneSignal . completeNotificationEvent ( notification . notificationId , true ) ; } getNotification ( ) { return this . notification ; } }