Skip to content

Conversation

Doris-Ge
Copy link
Contributor

@Doris-Ge Doris-Ge commented Apr 5, 2023

  • Deprecate sendAll() and sendMulticast() APIs.
  • Add new sendEach() and sendEachForMulticast() APIs.

RELEASE NOTE: sendAll() and sendMulticast() APIs are now deprecated. Use sendEach() and sendEachForMulticast() APIs instead.

Doris-Ge added 2 commits April 5, 2023 22:17
`SendEachForMulticastDryRun`

1. Add `SendEach`, `SendEachDryRun`, `SendEachForMulticast`,
   `SendEachForMulticastDryRun`
2. Deprecate `SendAll`, `SendAllDryRun`, `SendMulticast`,
   `SendMulticastDryRun`

`SendEach` vs `SendAll`
1. `SendEach` sends one HTTP request to V1 Send endpoint for each
    message in the array.
   `SendAll` sends only one HTTP request to V1 Batch Send endpoint
    to send all messages in the array.
2. `SendEach` calls fcmClient.Send to send each message
    and constructs a SendResponse with the returned message id or error.
    `SendEach` uses sync.WaitGroup to execute all fcmClient.Send calls
    asynchronously and wait for all of them to complete and construct a
    BatchResponse with all SendResponses.
    Therefore, unlike `SendAll`, `SendEach` does not always returns
    an error for a total failure. It can also return a `BatchResponse`
    with only errors in it.

`SendEachForMulticast` calls `SendEach` under the hood.
@lahirumaramba
Copy link
Member

Thank you @Doris-Ge. Please get the reference docs reviewed by @egilmorez before we merge this.

@Doris-Ge Doris-Ge force-pushed the fcm-batch-send-dev branch from a386d67 to e73585b Compare April 11, 2023 23:29
@Doris-Ge Doris-Ge merged commit 3fb1538 into dev Apr 21, 2023
@lahirumaramba lahirumaramba changed the title feat(fcm): SendEach and SendEachForMulticast for FCM batch send feat(fcm): SendEach and SendEachForMulticast for FCM batch send Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:stage Stage a release candidate release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants