Skip to content

Commit

Permalink
Merge pull request #266 from adobe/staging
Browse files Browse the repository at this point in the history
staging to main for 3.2.0 release
  • Loading branch information
sbenedicadb authored Aug 19, 2024
2 parents 4b75847 + 637dadb commit d85c573
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 30 deletions.
8 changes: 4 additions & 4 deletions Documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- Prerequisites
- Enable push notifications in your app by [adding the Firebase dependency.](https://firebase.google.com/docs/cloud-messaging/android/client)
- Developer Documentation
- [API usage](./sources/api-usage.md#Push Messaging APIs)
- [API usage](./sources/api-usage.md#push-messaging-apis)
- [PushTrackingStatus](./sources/enum-public-classes/enum-push-tracking-status.md)
- [MessagingPushPayload](./sources/enum-public-classes/messaging-push-payload.md)
- Guides
Expand All @@ -23,7 +23,7 @@
### In-app Messaging

- Developer Documentation
- [API usage](./sources/api-usage.md#In-App Messaging APIs)
- [API usage](./sources/api-usage.md#in-app-messaging-apis)
- [Message](./sources/enum-public-classes/class-message.md)
- Guides
- [Programmatically control the display of in-app messages](./sources/in-app-messaging/how-to-presentation-delegate.md)
Expand All @@ -34,9 +34,9 @@
### Code-based experiences and content cards

- Developer Documentation
- [API usage](./sources/api-usage.md#Message Feed and Code-based experiences APIs)
- [API usage](./sources/api-usage.md#code-based-experiences-and-content-cards-apis)
- Public classes
- [ContentCard](./sources/propositions/content-card.md)
- [ContentCard - DEPRECATED](./sources/propositions/content-card.md)
- [ContentType](./sources/propositions/schemas/content-type.md)
- [Proposition](./sources/propositions/proposition.md)
- [PropositionItem](./sources/propositions/proposition-item.md)
Expand Down
4 changes: 3 additions & 1 deletion Documentation/sources/propositions/content-card.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ContentCard
# ContentCard - DEPRECATED

> This class is *DEPRECATED* as of `Messaging v3.2.0`. Use [ContentCardSchemaData](./schemas/content-card-schema-data.md) instead.
An object representing the default content card created in the Adobe Journey Optimizer UI.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public class ContentCardSchemaData implements SchemaData {

# Public functions

## getContentCard
## getContentCard - DEPRECATED

> The `ContentCard` class is *DEPRECATED* as of `Messaging v3.2.0`.
Tries to convert the `content` of this `ContentCardSchemaData` into a [`ContentCard`](./../content-card.md) object.

Expand Down
2 changes: 1 addition & 1 deletion code/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ org.gradle.caching=true
android.useAndroidX=true

moduleName=messaging
moduleVersion=3.1.0
moduleVersion=3.2.0

#Maven artifact
mavenRepoName=AdobeMobileMessagingSdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
* A {@link ContentCard} object encapsulates the information necessary for a non-disruptive yet
* interactive offer. Customers can use the Messaging SDK to render the content card in a
* pre-defined format or implement their own rendering.
*
* @deprecated Use {@link ContentCardSchemaData} instead
*/
@Deprecated
public class ContentCard {
private static final String SELF_TAG = "ContentCard";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ static ContentCardSchemaData getEmpty() {
return new ContentCardSchemaData(new JSONObject());
}

@Deprecated
@Nullable public ContentCard getContentCard() {
if (!contentType.equals(ContentType.APPLICATION_JSON)) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* interactive offer. Customers can use the Messaging SDK to render the feed item data in a
* pre-defined format or implement their own rendering.
*
* @deprecated Use {@link ContentCard} instead.
* @deprecated Use {@link ContentCardSchemaData} instead
*/
@Deprecated
public class FeedItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public final class MessagingConstants {

public static final String LOG_TAG = "Messaging";
static final String EXTENSION_VERSION = "3.1.0";
static final String EXTENSION_VERSION = "3.2.0";
static final String FRIENDLY_EXTENSION_NAME = "Messaging";
static final String EXTENSION_NAME = "com.adobe.messaging";
static final String RULES_ENGINE_NAME = EXTENSION_NAME + ".rulesengine";
Expand Down
16 changes: 0 additions & 16 deletions code/messaging/src/main/res/values/strings.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import java.util.Map;

public final class Messaging {
private static final String EXTENSION_VERSION = "3.1.0";
private static final String EXTENSION_VERSION = "3.2.0";
private static final String LOG_TAG = "Messaging";
private static final String CLASS_NAME = "Messaging";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void test_evaluate_WithMissingDataInConsequencesDetail() {
contentCardRulesEngine.evaluate(defaultEvent);

// verify
Assert.assertTrue(propositionItemsBySurface.isEmpty());
Assert.assertNull(propositionItemsBySurface);
}

@Test
Expand All @@ -166,6 +166,6 @@ public void test_evaluate_WithMissingSurfaceInConsequencesDetailMetadata() {
contentCardRulesEngine.evaluate(defaultEvent);

// verify
Assert.assertTrue(propositionItemsBySurface.isEmpty());
Assert.assertNull(propositionItemsBySurface);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"key": "~timestampu",
"matcher": "le",
"values": [
1723163897
2039020785
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ class FeedCardAdapter(propositions: MutableList<Proposition>) :
val proposition = propositions[position]
for (item in proposition.items) {
val inboundContent = item.contentCardSchemaData
val contentCard = inboundContent?.contentCard
val contentMap = inboundContent?.content as HashMap<String, String>
val contentCard = MyContentCard()
contentCard.title = contentMap.get("title") ?: "defaultTitle"
contentCard.body = contentMap.get("body") ?: "defaultBody"
contentCard.imageUrl = contentMap.get("imageUrl") ?: "defaultImage"
contentCard?.let {
it.imageUrl?.let {
holder.feedItemImage.setImageBitmap(ImageDownloader.getImage(it))
Expand Down Expand Up @@ -80,4 +84,10 @@ class FeedCardAdapter(propositions: MutableList<Proposition>) :
init {
this.propositions = propositions
}
}

class MyContentCard {
var title: String = ""
var body: String = ""
var imageUrl: String = ""
}

0 comments on commit d85c573

Please sign in to comment.