This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,16 @@ var GOOGLE_SIGNIN_INTENT_ID = 123;
2424 var extras = intent . getExtras ( ) ;
2525 if ( extras !== null ) {
2626 var result = {
27- foreground : false
27+ foreground : false ,
28+ data : { }
2829 } ;
2930
3031 var iterator = extras . keySet ( ) . iterator ( ) ;
3132 while ( iterator . hasNext ( ) ) {
3233 var key = iterator . next ( ) ;
3334 if ( key !== "from" && key !== "collapse_key" ) {
3435 result [ key ] = extras . get ( key ) ;
36+ result . data [ key ] = extras . get ( key ) ;
3537 }
3638 }
3739
@@ -339,7 +341,7 @@ firebase.analytics.logEvent = function (arg) {
339341
340342 resolve ( ) ;
341343 } catch ( ex ) {
342- console . log ( "Error in firebase.logEvent: " + ex ) ;
344+ console . log ( "Error in firebase.analytics. logEvent: " + ex ) ;
343345 reject ( ex ) ;
344346 }
345347 } ) ;
@@ -361,7 +363,7 @@ firebase.analytics.setUserProperty = function (arg) {
361363
362364 resolve ( ) ;
363365 } catch ( ex ) {
364- console . log ( "Error in firebase.setUserProperty: " + ex ) ;
366+ console . log ( "Error in firebase.analytics. setUserProperty: " + ex ) ;
365367 reject ( ex ) ;
366368 }
367369 } ) ;
Original file line number Diff line number Diff line change @@ -179,6 +179,8 @@ firebase._processPendingNotifications = function() {
179179 userInfoJSON . title = userInfoJSON . aps . alert . title ;
180180 userInfoJSON . body = userInfoJSON . aps . alert . body ;
181181 }
182+ // also, to make the ts.d happy copy all properties to a data element
183+ userInfoJSON . data = userInfoJSON ;
182184 // cleanup
183185 userInfoJSON . aps = undefined ;
184186 firebase . _receivedNotificationCallback ( userInfoJSON ) ;
Original file line number Diff line number Diff line change @@ -358,6 +358,10 @@ export interface Message {
358358 * Not available on Android when the notification was received in the background.
359359 */
360360 title ?: string ;
361+ /**
362+ * Any other data you may have added to the notification.
363+ */
364+ data : any ;
361365}
362366
363367export interface ProgressStatus {
You can’t perform that action at this time.
0 commit comments