From 334aa44e0f7a3418dbe5cb0da3dcc0abd442c967 Mon Sep 17 00:00:00 2001 From: Jason Heron Date: Thu, 9 Jul 2020 10:31:57 -0700 Subject: [PATCH] Cleaning up and addressing issues with FIAM docs (#1693) --- .../FirebaseInAppMessagingDisplay.java | 5 +- .../FirebaseInAppMessaging.java | 4 +- .../firebase/inappmessaging/model/Action.java | 2 +- .../model/CampaignMetadata.java | 10 +++- .../inappmessaging/model/CardMessage.java | 10 ++-- .../inappmessaging/model/ImageData.java | 2 + .../inappmessaging/model/InAppMessage.java | 46 +++++++++++++++---- .../model/TriggeredInAppMessage.java | 1 - 8 files changed, 54 insertions(+), 26 deletions(-) diff --git a/firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/FirebaseInAppMessagingDisplay.java b/firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/FirebaseInAppMessagingDisplay.java index aa05bf5eb56..682580980cc 100644 --- a/firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/FirebaseInAppMessagingDisplay.java +++ b/firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/FirebaseInAppMessagingDisplay.java @@ -66,16 +66,13 @@ *

Firebase In-App Messaging Display will automatically initialize, start listening for events, * and display eligible in-app messages. * - *

This feature uses a Firebase Instance ID token to: + *

This feature uses a Firebase Installation ID token to: * *

- * - *

To delete the Instance ID and the data associated with it, see {@link - * FirebaseInstallationsApi#delete}. */ @FirebaseAppScope public class FirebaseInAppMessagingDisplay extends FirebaseInAppMessagingDisplayImpl { diff --git a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/FirebaseInAppMessaging.java b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/FirebaseInAppMessaging.java index 5aa4a5b04a8..8517350797e 100644 --- a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/FirebaseInAppMessaging.java +++ b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/FirebaseInAppMessaging.java @@ -37,7 +37,7 @@ * *

Firebase In-App Messaging will automatically initialize, and start listening for events. * - *

This feature uses a Firebase Instance ID token to: + *

This feature uses a Firebase Installation ID token to: * *

* - *

To delete the Instance ID and the data associated with it, see {@link + *

To delete the Installation ID and the data associated with it, see {@link * FirebaseInstallationsApi#delete()}. */ @FirebaseAppScope diff --git a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/Action.java b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/Action.java index cde51c98f4d..205ff9fa380 100644 --- a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/Action.java +++ b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/Action.java @@ -67,7 +67,7 @@ private Action(@Nullable String actionUrl, @Nullable Button button) { this.button = button; } - /** Gets URL for action */ + /** Gets the URL associated with this action */ @Nullable public String getActionUrl() { return actionUrl; diff --git a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/CampaignMetadata.java b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/CampaignMetadata.java index 9c184cc4983..3bbac3af272 100644 --- a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/CampaignMetadata.java +++ b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/CampaignMetadata.java @@ -16,7 +16,12 @@ import androidx.annotation.NonNull; -/** Provides the following about any message, */ +/** + * Provides the following about any message, + *

  • Campaign ID + *
  • Campaign Name + *
  • Campaign Test Message State + */ public class CampaignMetadata { private final String campaignId; private final String campaignName; @@ -33,16 +38,19 @@ public CampaignMetadata(String campaignId, String campaignName, boolean isTestMe this.isTestMessage = isTestMessage; } + /** Gets the campaign id associated with this message */ @NonNull public String getCampaignId() { return campaignId; } + /** Gets the campaign name associated with this message */ @NonNull public String getCampaignName() { return campaignName; } + /** Returns true if the message is a test message */ public boolean getIsTestMessage() { return isTestMessage; } diff --git a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/CardMessage.java b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/CardMessage.java index 078af58e662..a560a8e822a 100644 --- a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/CardMessage.java +++ b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/CardMessage.java @@ -119,7 +119,7 @@ public ImageData getPortraitImageData() { return portraitImageData; } - /** Gets the {@link ImageData} displayed when the phone is in a landcscape orientation */ + /** Gets the {@link ImageData} displayed when the phone is in a landscape orientation */ @Nullable public ImageData getLandscapeImageData() { return landscapeImageData; @@ -147,10 +147,7 @@ public Action getSecondaryAction() { return secondaryAction; } - /** - * @deprecated Use getPrimaryAction() instead. Gets the primary {@link Action} associated with - * this message - */ + /** @deprecated Use {@link #getPrimaryAction()} or {@link #getSecondaryAction()} instead. */ @Nullable @Deprecated @Override @@ -173,8 +170,7 @@ public Text getBody() { } /** - * @deprecated Use getPortraitImageData() instead. Gets the {@link ImageData} associated with this - * message + * @deprecated Use {@link #getPortraitImageData()} or {@link #getLandscapeImageData()} instead. */ @Nullable @Deprecated diff --git a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/ImageData.java b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/ImageData.java index 92b89f6833b..11ec096a544 100644 --- a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/ImageData.java +++ b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/ImageData.java @@ -65,11 +65,13 @@ public ImageData(@NonNull String imageUrl, @Nullable Bitmap bitmapData) { this.bitmapData = bitmapData; } + /** Gets the URL associated with this image */ @NonNull public String getImageUrl() { return imageUrl; } + /** Gets the bitmap associated with this image */ @Nullable public Bitmap getBitmapData() { return bitmapData; diff --git a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/InAppMessage.java b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/InAppMessage.java index 4d5fa1086f9..b3b06b94fa5 100644 --- a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/InAppMessage.java +++ b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/InAppMessage.java @@ -70,35 +70,50 @@ public InAppMessage( this.data = data; } - /** @deprecated Use the message specific methods instead. */ + /** + * @deprecated Use the message specific methods (see {@link CardMessage}, {@link ModalMessage}, + * {@link BannerMessage}, {@link ImageOnlyMessage}) instead. + */ @Nullable @Deprecated public Text getTitle() { return title; } - /** @deprecated Use the message specific methods (see {@link CardMessage}) instead. */ + /** + * @deprecated Use the message specific methods (see {@link CardMessage}, {@link ModalMessage}, + * {@link BannerMessage}, {@link ImageOnlyMessage}) instead. + */ @Nullable @Deprecated public Text getBody() { return body; } - /** @deprecated Use the message specific methods (see {@link CardMessage}) instead. */ + /** + * @deprecated Use the message specific methods (see {@link CardMessage}, {@link ModalMessage}, + * {@link BannerMessage}, {@link ImageOnlyMessage}) instead. + */ @Nullable @Deprecated public String getImageUrl() { return imageUrl; } - /** @deprecated Use the message specific methods (see {@link CardMessage}) instead. */ + /** + * @deprecated Use the message specific methods (see {@link CardMessage}, {@link ModalMessage}, + * {@link BannerMessage}, {@link ImageOnlyMessage}) instead. + */ @Nullable @Deprecated public ImageData getImageData() { return imageData; } - /** @deprecated Use the message specific methods (see {@link CardMessage}) */ + /** + * @deprecated Use the message specific methods (see {@link CardMessage}, {@link ModalMessage}, + * {@link BannerMessage}, {@link ImageOnlyMessage}) instead. + */ @Nullable @Deprecated public Button getActionButton() { @@ -108,33 +123,39 @@ public Button getActionButton() { return actionButton; } - /** @deprecated Use the message specific methods (see {@link CardMessage}) instead. */ + /** + * @deprecated Use the message specific methods (see {@link CardMessage}, {@link ModalMessage}, + * {@link BannerMessage}, {@link ImageOnlyMessage}) instead. + */ @Deprecated @Nullable public abstract Action getAction(); - /** @deprecated Use the message specific methods (see {@link CardMessage}) instead. */ + /** + * @deprecated Use the message specific methods (see {@link CardMessage}, {@link ModalMessage}, + * {@link BannerMessage}, {@link ImageOnlyMessage}) instead. + */ @Nullable @Deprecated public String getBackgroundHexColor() { return backgroundHexColor; } - /** @deprecated Use getCampaignMetadata().getCampaignId() instead. */ + /** @deprecated Use {@link #getCampaignMetadata()#getCampaignId()} instead. */ @Nullable @Deprecated public String getCampaignId() { return campaignMetadata.getCampaignId(); } - /** @deprecated Use getCampaignMetadata().getCampaignName() instead. */ + /** @deprecated Use {@link #getCampaignMetadata()#getCampaignName()} instead. */ @Nullable @Deprecated public String getCampaignName() { return campaignMetadata.getCampaignName(); } - /** @deprecated Use getCampaignMetadata().getIsTestMessage() instead. */ + /** @deprecated Use {@link #getCampaignMetadata()#getIsTestMessage()} instead. */ @Nullable @Deprecated public Boolean getIsTestMessage() { @@ -146,12 +167,17 @@ public Boolean getIsTestMessage() { public MessageType getMessageType() { return messageType; } + /** Gets the {@link CampaignMetadata} of the message */ @Nullable public CampaignMetadata getCampaignMetadata() { return campaignMetadata; } + /** + * Gets the extra data map of the message. This is defined in the Firebase Console for each + * campaign. + */ @Nullable public Map getData() { return data; diff --git a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/TriggeredInAppMessage.java b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/TriggeredInAppMessage.java index 13907bb1381..c20078ba293 100644 --- a/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/TriggeredInAppMessage.java +++ b/firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/TriggeredInAppMessage.java @@ -25,7 +25,6 @@ public TriggeredInAppMessage(InAppMessage inAppMessage, String triggeringEvent) } public InAppMessage getInAppMessage() { - return inAppMessage; }