Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

[Android] send data object along with notification #1212

Merged
merged 1 commit into from
Apr 26, 2020

Conversation

r0b0t3d
Copy link
Contributor

@r0b0t3d r0b0t3d commented Oct 14, 2019

I got an issue with FCM notification that there is no data property in notification data when receiving notification.

{
    foreground: false, // BOOLEAN: If the notification was received in foreground or not
    userInteraction: false, // BOOLEAN: If the notification was opened by the user from the notification area or not
    message: 'My Notification Message', // STRING: The notification message
    data: {}, // OBJECT: The push data
}

This PR will send data via onNotification with data property.

@alexparlett
Copy link

This is a critical improvement can we look at getting it added?

@Dallas62 Dallas62 changed the base branch from master to dev April 26, 2020 10:24
@Dallas62 Dallas62 merged commit e3a5a81 into zo0r:dev Apr 26, 2020
@geraintwhite
Copy link
Contributor

I think this was actually a breaking change as the structure of notification payloads is now different on Android.

Example payload in 3.1.9:

  { notification: 
    { foreground: true,
      finish: [Function: finish],
      registrationId: '6440dadc-26c5-4ac7-85ea-d53b034912d6:0f4ff7116ad49c3e',
      userInteraction: false,
      id: '-1474261039',
      ver: '1',
      type: 'MWI',
      newVM: '0',
      oldVM: '0',
      newUrgentVM: '0',
      oldUrgentVM: '0' } }

Example payload in 3.4.0:

  { notification: 
    { foreground: true,
      finish: [Function: finish],
      userInteraction: false,
      id: '-1249963574',
      data: 
       { registrationId: '6440dadc-26c5-4ac7-85ea-d53b034912d6:0f4ff7116ad49c3e',
         ver: '1',
         type: 'MWI',
         newVM: '0',
         oldVM: '0',
         newUrgentVM: '0',
         oldUrgentVM: '0' } } }

@Davete0302
Copy link

Is this solved?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants