@@ -95,27 +95,30 @@ Notifications.configure = function(options) {
9595 this . isLoaded = true ;
9696 }
9797
98- const handlePopInitialNotification = function ( state ) {
98+ const handlePopInitialNotification = ( state ) => {
9999 if ( 'active' !== state ) {
100100 return ;
101101 }
102102
103103 if ( options . popInitialNotification === undefined || options . popInitialNotification === true ) {
104104 this . popInitialNotification ( function ( firstNotification ) {
105- if ( firstNotification !== null ) {
106- if ( false === firstNotification . userInteraction || this . idInitialNotification === firstNotification . id ) {
107- return ;
108- }
109-
110- this . idInitialNotification = firstNotification . id ;
111- this . _onNotification ( firstNotification , true ) ;
105+ if ( ! firstNotification ) {
106+ return ;
112107 }
108+
109+ if ( false === firstNotification . userInteraction || this . idInitialNotification === firstNotification . id ) {
110+ return ;
111+ }
112+
113+ this . idInitialNotification = firstNotification . id ;
114+ this . _onNotification ( firstNotification , true ) ;
113115 } . bind ( this ) ) ;
114116 }
115117 }
116118
117119 AppState . addEventListener ( 'change' , handlePopInitialNotification . bind ( this ) ) ;
118- handlePopInitialNotification ( ) ;
120+
121+ handlePopInitialNotification ( AppState . currentState ) ;
119122
120123 if ( options . requestPermissions !== false ) {
121124 this . _requestPermissions ( ) ;
@@ -499,7 +502,7 @@ Notifications.getScheduledLocalNotifications = function(callback) {
499502 soundName : notif . soundName ,
500503 repeatInterval : notif . repeatInterval ,
501504 id : notif . userInfo ?. id ,
502- date : new Date ( notif . fireDate ) ,
505+ date : new Date ( notif . fireDate ) ,
503506 number : notif ?. applicationIconBadgeNumber ,
504507 message : notif ?. alertBody ,
505508 title : notif ?. alertTitle ,
0 commit comments