Skip to content

Allow user to send data-only or custom notification payload#54

Merged
onmyway133 merged 1 commit intoonmyway133:masterfrom
namnm:master
Aug 12, 2022
Merged

Allow user to send data-only or custom notification payload#54
onmyway133 merged 1 commit intoonmyway133:masterfrom
namnm:master

Conversation

@namnm
Copy link
Copy Markdown
Contributor

@namnm namnm commented May 5, 2021

If payload.data or payload.notification is present, we merge the whole payload to the fcm message object.
This will solve the case user need to send data-only or custom notification payload

For eg:

{
  "data": {
    "title": "Title from data-only",
    "body": "Body from data-only",
    // ... Other data fields
  }
}

@Ariandr
Copy link
Copy Markdown
Collaborator

Ariandr commented May 6, 2021

Hi @namnm
Thank you for the PR!

Have you done manual testing of the updated logic?
Does it work for all cases it worked before?

@namnm
Copy link
Copy Markdown
Contributor Author

namnm commented May 6, 2021

Hi @Ariandr

I tested a bit with the new logic. Look at the code, it would only affect if the json user put it has data or notification object, in that case we will override those default fields.

If the json has no data or notification object, it would be working as usual.

@Ariandr
Copy link
Copy Markdown
Collaborator

Ariandr commented May 6, 2021

Okay @namnm, but at the moment I cannot test Android notifications personally. If @onmyway133 approves, we will deliver it.

Hi @onmyway133
Please have a look, if everything is okay, I will merge this PR and create a new release.

@Ariandr Ariandr requested a review from onmyway133 May 6, 2021 10:32
@Ariandr
Copy link
Copy Markdown
Collaborator

Ariandr commented May 24, 2021

Hi @onmyway133
Do you have a chance to review this PR?

If you approve, I will create a release.

@onmyway133 onmyway133 merged commit d6636ae into onmyway133:master Aug 12, 2022
@Ariandr
Copy link
Copy Markdown
Collaborator

Ariandr commented Aug 12, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants