From 3afbcf0ac19087e318b42a09131b4e6e145b7b44 Mon Sep 17 00:00:00 2001 From: Chong Shao Date: Tue, 12 Jan 2021 22:01:57 -0800 Subject: [PATCH 1/3] Update doc string for dryRun in FCM send methods to mention that it cannot be used to validate APNS tokens. --- .../firebase/messaging/FirebaseMessaging.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java b/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java index a08e8cfaf..666679a7e 100644 --- a/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java +++ b/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java @@ -90,7 +90,9 @@ public String send(@NonNull Message message) throws FirebaseMessagingException { * Sends the given {@link Message} via Firebase Cloud Messaging. * *

If the {@code dryRun} option is set to true, the message will not be actually sent. Instead - * FCM performs all the necessary validations, and emulates the send operation. + * FCM performs all the necessary validations, and emulates the send operation. {@code dryRun} + * option is useful for validating if an FCM registration has been deleted. But it cannot be used + * to validate APNS tokens. * * @param message A non-null {@link Message} to be sent. * @param dryRun a boolean indicating whether to perform a dry run (validation only) of the send. @@ -161,8 +163,10 @@ public BatchResponse sendAll( * send the entire list as a single RPC call. Compared to the {@link #send(Message)} method, this * is a significantly more efficient way to send multiple messages. * - *

If the {@code dryRun} option is set to true, the messages will not be actually sent. Instead - * FCM performs all the necessary validations, and emulates the send operation. + *

If the {@code dryRun} option is set to true, the message will not be actually sent. Instead + * FCM performs all the necessary validations, and emulates the send operation. {@code dryRun} + * option is useful for validating if an FCM registration has been deleted. But it cannot be used + * to validate APNS tokens. * *

The responses list obtained by calling {@link BatchResponse#getResponses()} on the return * value corresponds to the order of input messages. @@ -227,7 +231,9 @@ public BatchResponse sendMulticast( * Sends the given multicast message to all the FCM registration tokens specified in it. * *

If the {@code dryRun} option is set to true, the message will not be actually sent. Instead - * FCM performs all the necessary validations, and emulates the send operation. + * FCM performs all the necessary validations, and emulates the send operation. {@code dryRun} + * option is useful for validating if an FCM registration has been deleted. But it cannot be used + * to validate APNS tokens. * *

This method uses the {@link #sendAll(List)} API under the hood to send the given * message to all the target recipients. The responses list obtained by calling From 7a05b0074102eb8c8baaa20b10969b0b8c75cbd1 Mon Sep 17 00:00:00 2001 From: Chong Shao Date: Thu, 21 Jan 2021 10:19:49 -0800 Subject: [PATCH 2/3] Address reviewers comments --- .../firebase/messaging/FirebaseMessaging.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java b/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java index 666679a7e..b894c4e83 100644 --- a/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java +++ b/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java @@ -90,9 +90,9 @@ public String send(@NonNull Message message) throws FirebaseMessagingException { * Sends the given {@link Message} via Firebase Cloud Messaging. * *

If the {@code dryRun} option is set to true, the message will not be actually sent. Instead - * FCM performs all the necessary validations, and emulates the send operation. {@code dryRun} - * option is useful for validating if an FCM registration has been deleted. But it cannot be used - * to validate APNS tokens. + * FCM performs all the necessary validations, and emulates the send operation. The {@code dryRun} + * option is useful for determining whether an FCM registration has been deleted. But it cannot be + * used to validate APNs tokens. * * @param message A non-null {@link Message} to be sent. * @param dryRun a boolean indicating whether to perform a dry run (validation only) of the send. @@ -164,9 +164,9 @@ public BatchResponse sendAll( * is a significantly more efficient way to send multiple messages. * *

If the {@code dryRun} option is set to true, the message will not be actually sent. Instead - * FCM performs all the necessary validations, and emulates the send operation. {@code dryRun} - * option is useful for validating if an FCM registration has been deleted. But it cannot be used - * to validate APNS tokens. + * FCM performs all the necessary validations, and emulates the send operation. The {@code dryRun} + * option is useful for determining whether an FCM registration has been deleted. But it cannot be + * used to validate APNs tokens. * *

The responses list obtained by calling {@link BatchResponse#getResponses()} on the return * value corresponds to the order of input messages. @@ -231,9 +231,9 @@ public BatchResponse sendMulticast( * Sends the given multicast message to all the FCM registration tokens specified in it. * *

If the {@code dryRun} option is set to true, the message will not be actually sent. Instead - * FCM performs all the necessary validations, and emulates the send operation. {@code dryRun} - * option is useful for validating if an FCM registration has been deleted. But it cannot be used - * to validate APNS tokens. + * FCM performs all the necessary validations, and emulates the send operation. The {@code dryRun} + * option is useful for determining whether an FCM registration has been deleted. But it cannot be + * used to validate APNs tokens. * *

This method uses the {@link #sendAll(List)} API under the hood to send the given * message to all the target recipients. The responses list obtained by calling From 1eedc4d9c721993b865df15bcc3081135394dd44 Mon Sep 17 00:00:00 2001 From: Chong Shao Date: Fri, 19 Feb 2021 10:16:14 -0800 Subject: [PATCH 3/3] Address reviewers comments --- .../com/google/firebase/messaging/FirebaseMessaging.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java b/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java index b894c4e83..95366eaa7 100644 --- a/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java +++ b/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java @@ -90,9 +90,9 @@ public String send(@NonNull Message message) throws FirebaseMessagingException { * Sends the given {@link Message} via Firebase Cloud Messaging. * *

If the {@code dryRun} option is set to true, the message will not be actually sent. Instead - * FCM performs all the necessary validations, and emulates the send operation. The {@code dryRun} - * option is useful for determining whether an FCM registration has been deleted. But it cannot be - * used to validate APNs tokens. + * FCM performs all the necessary validations and emulates the send operation. The {@code dryRun} + * option is useful for determining whether an FCM registration has been deleted. However, it + * cannot be used to validate APNs tokens. * * @param message A non-null {@link Message} to be sent. * @param dryRun a boolean indicating whether to perform a dry run (validation only) of the send.