From 3b2cd760fe98d004436be686b180d0c95d61a5da Mon Sep 17 00:00:00 2001 From: Swarna Saraf Date: Fri, 8 Mar 2024 19:07:41 -0800 Subject: [PATCH 1/8] Added code-based channel support docs --- gatsby-config.js | 10 + .../code-based/api-reference.md | 48 +++++ .../code-based/index.md | 23 ++ .../code-based/tabs/api-reference.md | 188 +++++++++++++++++ .../edge/adobe-journey-optimizer/index.md | 1 + .../public-classes/proposition-item.md | 197 ++++++++++++++++++ .../public-classes/proposition.md | 91 ++++++++ .../public-classes/surface.md | 79 +++++++ .../public-classes/tabs/proposition-item.md | 143 +++++++++++++ .../public-classes/tabs/proposition.md | 43 ++++ .../public-classes/tabs/surface.md | 75 +++++++ 11 files changed, 898 insertions(+) create mode 100644 src/pages/edge/adobe-journey-optimizer/code-based/api-reference.md create mode 100644 src/pages/edge/adobe-journey-optimizer/code-based/index.md create mode 100644 src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md create mode 100644 src/pages/edge/adobe-journey-optimizer/public-classes/proposition-item.md create mode 100644 src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md create mode 100644 src/pages/edge/adobe-journey-optimizer/public-classes/surface.md create mode 100644 src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md create mode 100644 src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md create mode 100644 src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md diff --git a/gatsby-config.js b/gatsby-config.js index 2a5b1fbaed..662f1b5b38 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -239,6 +239,16 @@ module.exports = { } ] }, + { + title: "Code-based Experiences", + path: "/edge/adobe-journey-optimizer/code-based", + pages: [ + { + title: "API reference", + path: "/edge/adobe-journey-optimizer/code-based/api-reference" + } + ] + }, { title: "Public classes and enums", path: "/edge/adobe-journey-optimizer/public-classes", diff --git a/src/pages/edge/adobe-journey-optimizer/code-based/api-reference.md b/src/pages/edge/adobe-journey-optimizer/code-based/api-reference.md new file mode 100644 index 0000000000..7017aee394 --- /dev/null +++ b/src/pages/edge/adobe-journey-optimizer/code-based/api-reference.md @@ -0,0 +1,48 @@ +--- +title: Code-based Experiences - API Reference +description: This document lists the public APIs available in the Messaging extension for implementing code-based experiences. +keywords: +- Adobe Journey Optimizer +- API reference +- Messaging +- Code-based Experiences +--- + +import Tabs from './tabs/api-reference.md' + +# Code-based Experiences - API reference + +This document lists the public APIs available in the Messaging extension for implementing code-based experiences. + +## getPropositionsForSurfaces + +The `getPropositionsForSurfaces` API retrieves the previously fetched propositions from the SDK's in-memory propositions cache for the provided surfaces. The completion handler is invoked with the decision propositions corresponding to the given surfaces or `AEPError`, if it occurs. + +If a requested surface was not previously cached prior to calling `getPropositionsForSurfaces` (using the `updatePropositionsForSurfaces` API), no propositions will be returned for that surface. + + + +Android + + + +iOS + + + +## updatePropositionsForSurfaces + +The `updatePropositionsForSurfaces` API dispatches an event for the Edge network extension to fetch personalization decisions from the AJO campaigns for the provided surfaces array. The returned decision propositions are cached in-memory by the Messaging extension. + +To retrieve previously cached decision propositions, use `getPropositionsForSurfaces` API. + + + +Android + + + +iOS + + + diff --git a/src/pages/edge/adobe-journey-optimizer/code-based/index.md b/src/pages/edge/adobe-journey-optimizer/code-based/index.md new file mode 100644 index 0000000000..6759ce7076 --- /dev/null +++ b/src/pages/edge/adobe-journey-optimizer/code-based/index.md @@ -0,0 +1,23 @@ +--- +title: Code-based Experiences +description: This document guides you to integrating code-based experiences in your application. +keywords: +- Adobe Journey Optimizer +- Guide +- Code-based experiences +--- + +# Code-based Experiences + +This document guides you to integrating code-based experiences in your application. + +## API reference + +* [Code-based Experiences APIs](./api-reference.md) + +## Public Classes and Enums + +* [Class - Proposition](../public-classes/proposition.md) +* [Class - PropositionItem](../public-classes/proposition-item.md) +* [Enum - MessagingEdgeEventType](../public-classes/messaging-edge-event-type.md) +* [Class - Surface](../public-classes/surface.md) \ No newline at end of file diff --git a/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md b/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md new file mode 100644 index 0000000000..e4409ce0d0 --- /dev/null +++ b/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md @@ -0,0 +1,188 @@ +--- +noIndex: true +--- + + + +#### Java + +#### Syntax + +```java +public static void getPropositionsForSurfaces(@NonNull final List surfaces, @NonNull final AdobeCallback>> callback) +``` + +* _surfaces_ is a list of surfaces for which propositions are requested. +* _callback_ `call` method is invoked with propositions map of type `Map>`. If the callback is an instance of [AdobeCallbackWithError](../../../../home/base/mobile-core/api-reference.md#adobecallbackwitherror), and if the operation times out or an error occurs in retrieving propositions, the `fail` method is invoked with the appropriate [AdobeError](../../../../home/base/mobile-core/api-reference.md#adobeerror). + +#### Example + +```java +final Surface surface1 = new Surface("myActivity#button"); +final Surface surface2 = new Surface("myActivityAttributes"); + +final List surfaces = new ArrayList<>(); +surfaces.add(surface1); +surfaces.add(surface2); + +Messaging.getPropositionsForSurfaces(surfaces, new AdobeCallbackWithError>>() { + @Override + public void fail(final AdobeError adobeError) { + // handle error + } + + @Override + public void call(Map> propositionsMap) { + if (propositionsMap != null && !propositionsMap.isEmpty()) { + // get the propositions for the given surfaces + if (propositionsMap.contains(surface1)) { + final List propositions1 = propositionsMap.get(surface1) + // read surface1 propositions + } + if (propositionsMap.contains(surface2)) { + final List proposition2 = propositionsMap.get(surface2) + // read surface2 propositions + } + } + } +}); +``` + + + +#### Swift + +#### Syntax + +```swift +static func getPropositionsForSurfaces(_ surfacePaths: [Surface], _ completion: @escaping ([Surface: [Proposition]]?, Error?) -> Void) +``` + +* _surfaces_ is an array of surfaces for which propositions are requested. +* _completion_ is invoked with propositions dictionary of type `[Surface: [Proposition]]`. An `Error` is returned if SDK fails to retrieve the propositions. + +#### Example + +```swift +let surface1 = Surface(path: "myView#button") +let surface2 = Surface(path: "myViewAttributes") + +Messaging.getPropositionsForSurfaces([surface1, surface2]) { propositionsDict, error in + guard error == nil else { + // handle error + return + } + + guard let propositionsDict = propositionsDict else { + // bail early if no propositions + return + } + + // get the propositions for the given surfaces + if let propositions1 = propositionsDict[surface1] { + // read surface1 propositions + } + + if let propositions2 = propositionsDict[surface2] { + // read surface2 propositions + } +} +``` + +#### Objective-C + +#### Syntax + +```objc ++ (void) getPropositionsForSurfaces: (NSArray* _Nonnull) surfaces + completion: (void (^ _Nonnull)(NSDictionary*>* _Nullable propositionsDict, NSError* _Nullable error)) completion; +``` + +* _surfaces_ is an array of surfaces for which propositions are requested. +* _completion_ is invoked with propositions dictionary of type `NSDictionary*>`. An `NSError` is returned if SDK fails to retrieve the propositions. + +#### Example + +```objc +AEPSurface* surface1 = [[AEPSurface alloc] initWithPath: @"myView#button"]; +AEPSurface* surface2 = [[AEPSurface alloc] initWithPath: @"myView#button"]; + +[AEPMobileMessaging getPropositionsForSurfaces: @[surface1, surface2] + completion: ^(NSDictionary*>* propositionsDict, NSError* error) { + if (error != nil) { + // handle error + return; + } + + NSArray* proposition1 = propositionsDict[surface1]; + // read surface1 propositions + + NSArray* proposition2 = propositionsDict[surface2]; + // read surface2 propositions +}]; +``` + + + +#### Java + +#### Syntax + +```java +public static void updatePropositionsForSurfaces(@NonNull final List surfaces) +``` + +* _surfaces_ is a list of surfaces for which propositions need updating. + +#### Example + +```java +final Surface surface1 = new Surface("myActivity#button"); +final Surface surface2 = new Surface("myActivityAttributes"); + +final List surfaces = new ArrayList<>(); +surfaces.add(surface1); +surfaces.add(surface2); + +Messaging.updatePropositionsForSurfaces(surfaces) +``` + + + +#### Swift + +#### Syntax + +```swift +static func updatePropositionsForSurfaces(_ surfaces: [Surface]) +``` + +* _surfaces_ is an array of surfaces for which propositions need updating. + +#### Example + +```swift +let surface1 = Surface(path: "myView#button") +let surface2 = Surface(path: "myViewAttributes") + +Messaging.updatePropositionsForSurfaces([surface1, surface2]) +``` + +#### Objective-C + +#### Syntax + +```objc ++ (void) updatePropositionsForSurfaces: (NSArray* _Nonnull) surfaces; +``` + +* _surfaces_ is an array of surfaces for which propositions need updating. + +#### Example + +```objc +AEPSurface* surface1 = [[AEPSurface alloc] initWithPath: @"myView#button"]; +AEPSurface* surface2 = [[AEPSurface alloc] initWithPath: @"myView#button"]; + +[AEPMobileMessaging updatePropositionsForSurfaces: @[surface1, surface2]]; +``` \ No newline at end of file diff --git a/src/pages/edge/adobe-journey-optimizer/index.md b/src/pages/edge/adobe-journey-optimizer/index.md index 1a713561d4..c00ce3b639 100644 --- a/src/pages/edge/adobe-journey-optimizer/index.md +++ b/src/pages/edge/adobe-journey-optimizer/index.md @@ -100,3 +100,4 @@ You can update the SDK configuration, including the Messaging configuration valu * [Push notification implementation guide](./push-notification/index.md) * [In-App message implementation guide](./in-app-message/index.md) +* [Code-based experiences implementation guide](./code-based/index.md) \ No newline at end of file diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition-item.md b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition-item.md new file mode 100644 index 0000000000..7612b6653a --- /dev/null +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition-item.md @@ -0,0 +1,197 @@ +--- +title: PropositionItem +description: The `PropositionItem` class represents the decision proposition item received from the remote, upon a personalization query to the Experience Edge network. +keywords: +- Adobe Journey Optimizer +- Messaging +- PropositionItem +- Interface +- Android +- iOS +- Code-based Experiences +--- +import Tabs from './tabs/proposition-item.md' + +# PropositionItem + +The `PropositionItem` class represents the decision proposition item received from the remote, upon a personalization query to the Experience Edge network. + +## iOS Interface - PropositionItem + +## Public variables + +### itemId + +Unique proposition item identifier. + +```swift +public let itemId: String +``` + +### itemData + +Proposition item data as dictionary. + +```swift +public let itemData: [String: Any] +``` + +### schema + +Proposition item schema string. + +```swift +public let schema: String +``` + +### htmlContent + +Returns item data content as a string if the proposition item schema is `htmlContent`, otherwise returns `nil`. + +```swift +var htmlContent: String? +``` + +### jsonContentDictionary + +Returns item data content as a dictionary if it can be parsed as a dictionary and if the proposition item schema is `jsonContent`, otherwise returns `nil`. + +```swift +var jsonContentDictionary: [String: Any]? +``` + +### jsonContentArray + +Returns item data content as an array if it can be parsed as an array and if the proposition item schema is `jsonContent`, otherwise returns `nil`. + +```swift +var jsonContentArray: [Any]? +``` + +## Public functions + +### generateInteractionXdm + +Returns a dictionary containing XDM data for interaction with the given proposition item, for the provided event type. + + + +iOS + + + +### track + +Tracks interaction with the given proposition item. + + + +iOS + + + +## Android Interface - PropositionItem + +## Public functions + +### getItemId + +Returns this proposition item's unique identifier as a string. + + + +Android + + + +### getItemData + +Returns this proposition's unique identifier as a string. + + + +Android + + + +### getSchema + +Returns this proposition item's content schema as a string. + + + +Android + + + +### getHtmlContent + +Returns item data content as a string if the proposition item schema is `HTML_CONTENT`, otherwise returns null. + + + +Android + + + +### getJsonContentMap + +Returns item data content as a Map if it can be parsed as a Map and if the proposition item schema is `JSON_CONTENT`, otherwise returns null. + + + +Android + + + +### getJsonContentArrayList + +Returns item data content as a list if it can be parsed as a list and if the proposition item schema is `JSON_CONTENT`, otherwise returns null. + + + +Android + + + +### generateInteractionXdm + +Returns a Map containing XDM data for interaction with the given proposition item, for the provided event type. + + + +Android + + + +### generateInteractionXdm + +Returns a Map containing XDM data for interaction with the given proposition item, for the provided event type and decision item tokens. + + + +Android + + + +### track + +Tracks interaction with the given proposition item. + + + +Android + + + +### track + +Tracks interaction with the given proposition item for the provided decision item tokens. + + + +Android + + + + diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md new file mode 100644 index 0000000000..582bf3818b --- /dev/null +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md @@ -0,0 +1,91 @@ +--- +title: Proposition +description: The `Proposition` class represents the decision propositions received from the remote, upon a personalization query request to the Experience Edge network. +keywords: +- Adobe Journey Optimizer +- Messaging +- Proposition +- Interface +- Android +- iOS +- Code-based Experiences +--- +import Tabs from './tabs/proposition.md' + +# Proposition + +The `Proposition` class represents the decision propositions received from the remote, upon a personalization query request to the Experience Edge network. + +## iOS Interface - Proposition + +## Public variables + +### uri + +Unique proposition identifier. + +```swift +public let uniqueId: String +``` + +### scope + +Scope string. + +```swift +public let scope: String +``` + +### items + +An array containing proposition decision items. + +```swift +public lazy var items: [PropositionItem] +``` + +## Android Interface - Proposition + +## Public functions + +### getItems + +Returns this proposition's unique identifier as a string. + + + +Android + + + +### getScope + +Returns this proposition's unique identifier as a string. + + + +Android + + + +### getScopeDetails + +Returns this proposition's unique identifier as a string. + + + +Android + + + +### getUniqueId + +Returns this proposition's unique identifier as a string. + + + +Android + + + + diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/surface.md b/src/pages/edge/adobe-journey-optimizer/public-classes/surface.md new file mode 100644 index 0000000000..f11fd40091 --- /dev/null +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/surface.md @@ -0,0 +1,79 @@ +--- +title: Surface +description: The `Surface` class contains the definition of an in-app message and controls its tracking via Experience Edge events. +keywords: +- Adobe Journey Optimizer +- Messaging +- Surface +- Interface +- Android +- iOS +- Code-based Experiences +--- +import Tabs from './tabs/surface.md' + +# Surface + +The `Surface` class represents an entity for user or system interaction. It is identified by a self-describing URI which is used to fetch the decision propositions from the AJO campaigns. For example, all mobile application surface URIs start with `mobileapp://`, followed by app bundle identifier and an optional path. + +## iOS Interface - Surface + +`Surface` class is used to create surface instances for requesting propositions in personalization query requests. + +## Public variables + +### uri + +Unique surface URI string. + +```swift +public let uri: String +``` + +## Public functions + +### init + +Creates a new surface by appending the given surface `path` to the mobile app surface prefix. + + + +iOS + + + +## Android Interface - Surface + +`Surface` class is used to create surface objects for requesting propositions in personalization query requests. + +## Public functions + +### Parameterized Constructor + +Creates a new surface by appending the given surface `path` to the mobile app surface prefix. + + + +Android + + + +### Default Constructor + +Creates a new base surface by appending application package name to the mobile app surface prefix `mobileapp://`. + + + +Android + + + +### getUri + +Returns this surface's URI as a string. + + + +Android + + \ No newline at end of file diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md new file mode 100644 index 0000000000..c1ade28c72 --- /dev/null +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md @@ -0,0 +1,143 @@ +--- +noIndex: true +--- + + + +#### Swift + +#### Syntax + +```swift +func generateInteractionXdm(_ interaction: String? = nil, withEdgeEventType eventType: MessagingEdgeEventType, forTokens tokens: [String]? = nil) -> [String: Any]? +``` + +* _interaction_ is a custom string value describing the interaction. +* _eventType_ is an enum specifying event type for the interaction. +* _tokens_ is an array containing the decision item tokens for recording interaction. + + + +#### Swift + +#### Syntax + +```swift +func track(_ interaction: String? = nil, withEdgeEventType eventType: MessagingEdgeEventType, forTokens tokens: [String]? = nil) +``` + +* _interaction_ is a custom string value describing the interaction. +* _eventType_ is an enum specifying event type for the interaction. +* _tokens_ is an array containing the decision item tokens for recording interaction. + + + +#### Java + +#### Syntax + +```java +public String getItemId() +``` + + + +#### Java + +#### Syntax + +```java +public Map getData() +``` + + + +#### Java + +#### Syntax + +```java +public SchemaType getSchema() +``` + + + +#### Java + +#### Syntax + +```java +public String getHtmlContent() +``` + + + +#### Java + +#### Syntax + +```java +public Map getJsonContentMap() +``` + + + +#### Java + +#### Syntax + +```java +public List> getJsonArrayList() +``` + + + +#### Java + +#### Syntax + +```java +public Map generateInteractionXdm(@NonNull final MessagingEdgeEventType eventType) +``` + +* _eventType_ is an enum specifying event type for the interaction. + + + +#### Java + +#### Syntax + +```java +public Map generateInteractionXdm(final String interaction, @NonNull final MessagingEdgeEventType eventType, final List tokens) +``` + +* _interaction_ is a custom string value describing the interaction. +* _eventType_ is an enum specifying event type for the interaction. +* _tokens_ is a list containing the decision item tokens for recording interaction. + + + +#### Java + +#### Syntax + +```java +public void track(@NonNull final MessagingEdgeEventType eventType) +``` + +* _eventType_ is an enum specifying event type for the interaction. + + + +#### Java + +#### Syntax + +```java +public void track(final String interaction, @NonNull final MessagingEdgeEventType eventType, final List tokens) +``` + +* _interaction_ is a custom string value describing the interaction. +* _eventType_ is an enum specifying event type for the interaction. +* _tokens_ is a list containing the decision item tokens for recording interaction. \ No newline at end of file diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md new file mode 100644 index 0000000000..a97805f395 --- /dev/null +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md @@ -0,0 +1,43 @@ +--- +noIndex: true +--- + + + +#### Java + +#### Syntax + +```java +public List getItems() +``` + + + +#### Java + +#### Syntax + +```java +public String getScope() +``` + + + +#### Java + +#### Syntax + +```java +public Map getScopeDetails() +``` + + + +#### Java + +#### Syntax + +```java +public String getUniqueId() +``` \ No newline at end of file diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md new file mode 100644 index 0000000000..60d89496d1 --- /dev/null +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md @@ -0,0 +1,75 @@ +--- +noIndex: true +--- + + + +#### Swift + +#### Syntax + +```swift +public init(path: String) +``` + +* _path_ is a string representation for the surface path. + +#### Example + +```swift +// Creates a surface instance representing a banner within homeView view in my mobile application. +let surface = Surface(path: "homeView#banner") +``` + + + +#### Java + +#### Syntax + +```java +public Surface(final String path) +``` + +* _path_ is a string containing the surface path. + +#### Example + +```java +// Creates a surface instance representing a banner view within homeActivity in my mobile application. +final Surface surface = new Surface("homeActivity#banner") +``` + + + +#### Java + +#### Syntax + +```java +public Surface() +``` + +#### Example + +```java +// Creates a new base surface by appending application package name to the mobile app surface prefix mobileapp:// +final Surface surface = new Surface() +``` + + + +#### Java + +#### Syntax + +```java +public String getUri() +``` + +#### Example + +```java +final Surface surface = new Surface("homeActivity#banner") +final String uri = surface.getUri() +``` \ No newline at end of file From d6d2848821d35360ca19ff508e707b8ff5cac0eb Mon Sep 17 00:00:00 2001 From: Spoorthi Pujari <63024083+spoorthipujariadobe@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:46:12 -0700 Subject: [PATCH 2/8] code review comments --- gatsby-config.js | 12 +++++ .../code-based/tabs/api-reference.md | 24 +++++----- .../public-classes/proposition.md | 10 ---- .../public-classes/tabs/proposition-item.md | 48 +++++++++---------- .../public-classes/tabs/proposition.md | 23 +++------ .../public-classes/tabs/surface.md | 24 +++++----- 6 files changed, 66 insertions(+), 75 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 662f1b5b38..5b913800de 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -268,6 +268,18 @@ module.exports = { { title: "MessagingEdgeEventType", path: "/edge/adobe-journey-optimizer/public-classes/messaging-edge-event-type" + }, + { + title: "Proposition", + path: "/edge/adobe-journey-optimizer/public-classes/proposition" + }, + { + title: "PropositionItem", + path: "/edge/adobe-journey-optimizer/public-classes/proposition-item" + }, + { + title: "Surface", + path: "/edge/adobe-journey-optimizer/public-classes/surface" } ] }, diff --git a/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md b/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md index e4409ce0d0..6d34b6e883 100644 --- a/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md +++ b/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md @@ -6,7 +6,7 @@ noIndex: true #### Java -#### Syntax +**Syntax** ```java public static void getPropositionsForSurfaces(@NonNull final List surfaces, @NonNull final AdobeCallback>> callback) @@ -15,7 +15,7 @@ public static void getPropositionsForSurfaces(@NonNull final List surfa * _surfaces_ is a list of surfaces for which propositions are requested. * _callback_ `call` method is invoked with propositions map of type `Map>`. If the callback is an instance of [AdobeCallbackWithError](../../../../home/base/mobile-core/api-reference.md#adobecallbackwitherror), and if the operation times out or an error occurs in retrieving propositions, the `fail` method is invoked with the appropriate [AdobeError](../../../../home/base/mobile-core/api-reference.md#adobeerror). -#### Example +**Syntax** ```java final Surface surface1 = new Surface("myActivity#button"); @@ -52,7 +52,7 @@ Messaging.getPropositionsForSurfaces(surfaces, new AdobeCallbackWithError Void) @@ -61,7 +61,7 @@ static func getPropositionsForSurfaces(_ surfacePaths: [Surface], _ completion: * _surfaces_ is an array of surfaces for which propositions are requested. * _completion_ is invoked with propositions dictionary of type `[Surface: [Proposition]]`. An `Error` is returned if SDK fails to retrieve the propositions. -#### Example +**Syntax** ```swift let surface1 = Surface(path: "myView#button") @@ -91,7 +91,7 @@ Messaging.getPropositionsForSurfaces([surface1, surface2]) { propositionsDict, e #### Objective-C -#### Syntax +**Syntax** ```objc + (void) getPropositionsForSurfaces: (NSArray* _Nonnull) surfaces @@ -101,7 +101,7 @@ Messaging.getPropositionsForSurfaces([surface1, surface2]) { propositionsDict, e * _surfaces_ is an array of surfaces for which propositions are requested. * _completion_ is invoked with propositions dictionary of type `NSDictionary*>`. An `NSError` is returned if SDK fails to retrieve the propositions. -#### Example +**Syntax** ```objc AEPSurface* surface1 = [[AEPSurface alloc] initWithPath: @"myView#button"]; @@ -126,7 +126,7 @@ AEPSurface* surface2 = [[AEPSurface alloc] initWithPath: @"myView#button"]; #### Java -#### Syntax +**Syntax** ```java public static void updatePropositionsForSurfaces(@NonNull final List surfaces) @@ -134,7 +134,7 @@ public static void updatePropositionsForSurfaces(@NonNull final List su * _surfaces_ is a list of surfaces for which propositions need updating. -#### Example +**Syntax** ```java final Surface surface1 = new Surface("myActivity#button"); @@ -151,7 +151,7 @@ Messaging.updatePropositionsForSurfaces(surfaces) #### Swift -#### Syntax +**Syntax** ```swift static func updatePropositionsForSurfaces(_ surfaces: [Surface]) @@ -159,7 +159,7 @@ static func updatePropositionsForSurfaces(_ surfaces: [Surface]) * _surfaces_ is an array of surfaces for which propositions need updating. -#### Example +**Syntax** ```swift let surface1 = Surface(path: "myView#button") @@ -170,7 +170,7 @@ Messaging.updatePropositionsForSurfaces([surface1, surface2]) #### Objective-C -#### Syntax +**Syntax** ```objc + (void) updatePropositionsForSurfaces: (NSArray* _Nonnull) surfaces; @@ -178,7 +178,7 @@ Messaging.updatePropositionsForSurfaces([surface1, surface2]) * _surfaces_ is an array of surfaces for which propositions need updating. -#### Example +**Syntax** ```objc AEPSurface* surface1 = [[AEPSurface alloc] initWithPath: @"myView#button"]; diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md index 582bf3818b..e0bc05d80d 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md @@ -68,16 +68,6 @@ Android -### getScopeDetails - -Returns this proposition's unique identifier as a string. - - - -Android - - - ### getUniqueId Returns this proposition's unique identifier as a string. diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md index c1ade28c72..aa762dd900 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md @@ -2,11 +2,11 @@ noIndex: true --- - + #### Swift -#### Syntax +**Syntax** ```swift func generateInteractionXdm(_ interaction: String? = nil, withEdgeEventType eventType: MessagingEdgeEventType, forTokens tokens: [String]? = nil) -> [String: Any]? @@ -16,11 +16,11 @@ func generateInteractionXdm(_ interaction: String? = nil, withEdgeEventType even * _eventType_ is an enum specifying event type for the interaction. * _tokens_ is an array containing the decision item tokens for recording interaction. - + #### Swift -#### Syntax +**Syntax** ```swift func track(_ interaction: String? = nil, withEdgeEventType eventType: MessagingEdgeEventType, forTokens tokens: [String]? = nil) @@ -30,71 +30,71 @@ func track(_ interaction: String? = nil, withEdgeEventType eventType: MessagingE * _eventType_ is an enum specifying event type for the interaction. * _tokens_ is an array containing the decision item tokens for recording interaction. - + #### Java -#### Syntax +**Syntax** ```java public String getItemId() ``` - + #### Java -#### Syntax +**Syntax** ```java public Map getData() ``` - + #### Java -#### Syntax +**Syntax** ```java public SchemaType getSchema() ``` - + #### Java -#### Syntax +**Syntax** ```java public String getHtmlContent() ``` - + #### Java -#### Syntax +**Syntax** ```java public Map getJsonContentMap() ``` - + #### Java -#### Syntax +**Syntax** ```java public List> getJsonArrayList() ``` - + #### Java -#### Syntax +**Syntax** ```java public Map generateInteractionXdm(@NonNull final MessagingEdgeEventType eventType) @@ -102,11 +102,11 @@ public Map generateInteractionXdm(@NonNull final MessagingEdgeEv * _eventType_ is an enum specifying event type for the interaction. - + #### Java -#### Syntax +**Syntax** ```java public Map generateInteractionXdm(final String interaction, @NonNull final MessagingEdgeEventType eventType, final List tokens) @@ -116,11 +116,11 @@ public Map generateInteractionXdm(final String interaction, @Non * _eventType_ is an enum specifying event type for the interaction. * _tokens_ is a list containing the decision item tokens for recording interaction. - + #### Java -#### Syntax +**Syntax** ```java public void track(@NonNull final MessagingEdgeEventType eventType) @@ -128,11 +128,11 @@ public void track(@NonNull final MessagingEdgeEventType eventType) * _eventType_ is an enum specifying event type for the interaction. - + #### Java -#### Syntax +**Syntax** ```java public void track(final String interaction, @NonNull final MessagingEdgeEventType eventType, final List tokens) diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md index a97805f395..9db68e3c1b 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md @@ -2,41 +2,30 @@ noIndex: true --- - + #### Java -#### Syntax +**Syntax** ```java public List getItems() ``` - + #### Java -#### Syntax +**Syntax** ```java public String getScope() ``` - - - -#### Java - -#### Syntax - -```java -public Map getScopeDetails() -``` - - + #### Java -#### Syntax +**Syntax** ```java public String getUniqueId() diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md index 60d89496d1..0c2df10bb3 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md @@ -2,11 +2,11 @@ noIndex: true --- - + #### Swift -#### Syntax +**Syntax** ```swift public init(path: String) @@ -14,18 +14,18 @@ public init(path: String) * _path_ is a string representation for the surface path. -#### Example +**Example** ```swift // Creates a surface instance representing a banner within homeView view in my mobile application. let surface = Surface(path: "homeView#banner") ``` - + #### Java -#### Syntax +**Syntax** ```java public Surface(final String path) @@ -33,41 +33,41 @@ public Surface(final String path) * _path_ is a string containing the surface path. -#### Example +**Example** ```java // Creates a surface instance representing a banner view within homeActivity in my mobile application. final Surface surface = new Surface("homeActivity#banner") ``` - + #### Java -#### Syntax +**Syntax** ```java public Surface() ``` -#### Example +**Example** ```java // Creates a new base surface by appending application package name to the mobile app surface prefix mobileapp:// final Surface surface = new Surface() ``` - + #### Java -#### Syntax +**Syntax** ```java public String getUri() ``` -#### Example +**Example** ```java final Surface surface = new Surface("homeActivity#banner") From 107ab03e31bab14e7676a35c3839958a6b22e9ee Mon Sep 17 00:00:00 2001 From: Steve Benedick Date: Wed, 20 Mar 2024 19:06:46 -0600 Subject: [PATCH 3/8] -update outdated api reference section for messaging and optimize --- src/pages/resources/migration/ios/migrate-to-5x.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/resources/migration/ios/migrate-to-5x.md b/src/pages/resources/migration/ios/migrate-to-5x.md index facc554f0f..4c6b5a52ca 100644 --- a/src/pages/resources/migration/ios/migrate-to-5x.md +++ b/src/pages/resources/migration/ios/migrate-to-5x.md @@ -71,3 +71,11 @@ Once the previous command is complete, run `pod install` or `pod update` to upda If you are using Swift Package Manger (SPM) for managing your app dependencies, you can now include the Experience Platform 5.x SDKs either through Xcode UI, or by declaring them as dependencies in the Package.swift project file. For more details, follow the guide for [managing dependencies using Swift Package Manager](../../manage-spm-dependencies.md). ## Update outdated API references + +#### Messaging + +Change usages of `Messaging.handleNotificationResponse(_:applicationOpened:withCustomActionId:)` and `Messaging.handleNotificationResponse(_:closure:)` to `Messaging.handleNotificationResponse(_:urlHandler:closure:)` + +#### Optimize + +Change all references from class `Proposition` to `OptimizeProposition`. \ No newline at end of file From 594395187146f5b426179f4c6a848d4b5c0d2b01 Mon Sep 17 00:00:00 2001 From: Spoorthi Pujari <63024083+spoorthipujariadobe@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:02:53 -0700 Subject: [PATCH 4/8] CBE code review comments --- .../edge/adobe-journey-optimizer/public-classes/proposition.md | 2 +- .../public-classes/tabs/proposition-item.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md index e0bc05d80d..38781bf96d 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md @@ -20,7 +20,7 @@ The `Proposition` class represents the decision propositions received from the r ## Public variables -### uri +### uniqueId Unique proposition identifier. diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md index aa762dd900..e243d549e1 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md @@ -47,7 +47,7 @@ public String getItemId() **Syntax** ```java -public Map getData() +public Map getItemData() ``` From b72dfb121792ed258454d6cb1ceca6d7869b67f1 Mon Sep 17 00:00:00 2001 From: Steve Benedick Date: Fri, 22 Mar 2024 13:51:23 -0600 Subject: [PATCH 5/8] -updates for messaging cbe support --- .../api-reference.md | 2 +- .../tabs/api-reference.md | 14 ++--- .../code-based/tabs/api-reference.md | 12 +++++ .../public-classes/proposition-item.md | 6 ++- .../public-classes/proposition.md | 5 ++ .../public-classes/surface.md | 6 ++- .../tabs/messaging-edge-event-type.md | 26 ++++----- .../push-notification/ios/api-reference.md | 54 +++++++++++++------ .../adobe-journey-optimizer/release-notes.md | 8 +-- .../tabs/api-reference.md | 16 +++--- src/pages/home/release-notes/index.md | 6 +-- .../resources/migration/ios/migrate-to-5x.md | 15 ++++-- 12 files changed, 113 insertions(+), 57 deletions(-) diff --git a/src/pages/edge/adobe-journey-optimizer-decisioning/api-reference.md b/src/pages/edge/adobe-journey-optimizer-decisioning/api-reference.md index 5d211563c1..2fe18f4154 100644 --- a/src/pages/edge/adobe-journey-optimizer-decisioning/api-reference.md +++ b/src/pages/edge/adobe-journey-optimizer-decisioning/api-reference.md @@ -123,7 +123,7 @@ iOS -### Proposition +### Proposition/OptimizeProposition This class represents the decision propositions received from the decisioning services, upon a personalization query request to the Experience Edge network. diff --git a/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/api-reference.md b/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/api-reference.md index d0516f5f00..7bc82b7f7f 100644 --- a/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/api-reference.md +++ b/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/api-reference.md @@ -538,9 +538,9 @@ public class Proposition { #### Swift ```swift -/// `Proposition` class -@objc(AEPProposition) -public class Proposition: NSObject, Codable { +/// `OptimizeProposition` class +@objc(AEPOptimizeProposition) +public class OptimizeProposition: NSObject, Codable { /// Unique proposition identifier @objc public let id: String @@ -556,18 +556,18 @@ public class Proposition: NSObject, Codable { } ``` -The `Proposition` class extension provides a method for generating XDM data for Proposition Reference field group which can be used for proposition tracking. +The `OptimizeProposition` class extension provides a method for generating XDM data for Proposition Reference field group which can be used for proposition tracking. ```swift -/// `Proposition` extension +/// `OptimizeProposition` extension @objc -public extension Proposition { +public extension OptimizeProposition { /// Creates a dictionary containing XDM formatted data for `Experience Event - Proposition Reference` field group from the given proposition. /// /// The Edge `sendEvent(experienceEvent:_:)` API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, or override dataset identifier. /// /// - Note: The returned XDM data does not contain an `eventType` for the Experience Event. - /// - Returns A dictionary containing XDM data for the propositon reference. + /// - Returns A dictionary containing XDM data for the proposition reference. func generateReferenceXdm() -> [String: Any] {...} } ``` diff --git a/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md b/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md index 6d34b6e883..77a12ea468 100644 --- a/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md +++ b/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md @@ -2,6 +2,11 @@ noIndex: true --- + + +### Coming soon + + @@ -122,6 +128,11 @@ AEPSurface* surface2 = [[AEPSurface alloc] initWithPath: @"myView#button"]; }]; ``` + + +### Coming soon + + diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition-item.md b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition-item.md index 7612b6653a..6905f290df 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition-item.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition-item.md @@ -92,6 +92,10 @@ iOS ## Android Interface - PropositionItem +### Coming soon + + diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md index 38781bf96d..9906eb4be8 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md @@ -46,6 +46,10 @@ public lazy var items: [PropositionItem] ## Android Interface - Proposition +### Coming soon + + diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/surface.md b/src/pages/edge/adobe-journey-optimizer/public-classes/surface.md index f11fd40091..ea1d93358a 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/surface.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/surface.md @@ -44,6 +44,9 @@ iOS ## Android Interface - Surface +### Coming soon + + \ No newline at end of file diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/messaging-edge-event-type.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/messaging-edge-event-type.md index a867202e1f..e9747dbd80 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/messaging-edge-event-type.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/messaging-edge-event-type.md @@ -52,23 +52,23 @@ public enum MessagingEdgeEventType { ```swift @objc(AEPMessagingEdgeEventType) -public enum MessagingEdgeEventType: Int { - case inappDismiss = 0 - case inappInteract = 1 - case inappTrigger = 2 - case inappDisplay = 3 +public enum MessagingEdgeEventType: Int { case pushApplicationOpened = 4 case pushCustomAction = 5 + case dismiss = 6 + case interact = 7 + case trigger = 8 + case display = 9 public func toString() -> String { switch self { - case .inappDismiss: + case .dismiss: return MessagingConstants.XDM.IAM.EventType.DISMISS - case .inappTrigger: + case .trigger: return MessagingConstants.XDM.IAM.EventType.TRIGGER - case .inappInteract: + case .interact: return MessagingConstants.XDM.IAM.EventType.INTERACT - case .inappDisplay: + case .display: return MessagingConstants.XDM.IAM.EventType.DISPLAY case .pushCustomAction: return MessagingConstants.XDM.Push.EventType.CUSTOM_ACTION @@ -94,9 +94,9 @@ public enum MessagingEdgeEventType: Int { | Case | String value | | ---- | ------------ | -| inappDismiss | `decisioning.propositionDismiss` | -| inappInteract | `decisioning.propositionInteract` | -| inappTrigger | `decisioning.propositionTrigger` | -| inappDisplay | `decisioning.propositionDisplay` | +| dismiss | `decisioning.propositionDismiss` | +| interact | `decisioning.propositionInteract` | +| trigger | `decisioning.propositionTrigger` | +| display | `decisioning.propositionDisplay` | | pushApplicationOpened | `pushTracking.applicationOpened` | | pushCustomAction | `pushTracking.customAction` | diff --git a/src/pages/edge/adobe-journey-optimizer/push-notification/ios/api-reference.md b/src/pages/edge/adobe-journey-optimizer/push-notification/ios/api-reference.md index d5a2f9312f..f98929b32d 100644 --- a/src/pages/edge/adobe-journey-optimizer/push-notification/ios/api-reference.md +++ b/src/pages/edge/adobe-journey-optimizer/push-notification/ios/api-reference.md @@ -44,7 +44,7 @@ func application(_ application: UIApplication, didRegisterForRemoteNotifications ## Track push notification interactions -Use `handleNotificationResponse` API to send push notification interaction data to Adobe Experience Platform. +Use [`handleNotificationResponse`](./../../api-reference/#handlenotificationresponse) API to send push notification interaction data to Adobe Experience Platform. In iOS, [UNUserNotificationCenterDelegate](https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate) is the interface for processing incoming notifications and responding to notification actions. Once the delegate is implemented, handle push notification responses in [userNotificationCenter(_:didReceive:withCompletionHandler:)](https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate/1649501-usernotificationcenter) method. @@ -55,8 +55,20 @@ In iOS, [UNUserNotificationCenterDelegate](https://developer.apple.com/documenta ```swift func userNotificationCenter(_: UNUserNotificationCenter, didReceive response: UNNotificationResponse, - withCompletionHandler completionHandler: @escaping () -> Void) { - Messaging.handleNotificationResponse(response) + withCompletionHandler completionHandler: @escaping () -> Void) { + + Messaging.handleNotificationResponse(response, urlHandler: { url in + /// return `true` if the app is handling the url or `false` if the Adobe SDK should handle it + let appHandlesUrl = false + return appHandlesUrl + }, closure: { pushTrackingStatus in + if pushTrackingStatus == .trackingInitiated { + // tracking was successful + } else { + // tracking failed, view the status for more information + } + }) + completionHandler() } ``` @@ -64,11 +76,21 @@ func userNotificationCenter(_: UNUserNotificationCenter, #### Objective-C ```objc -- (void)userNotificationCenter:(UNUserNotificationCenter *)center -didReceiveNotificationResponse:(UNNotificationResponse *)response - withCompletionHandler:(void (^)(void))completionHandler { - - [AEPMobileMessaging handleNotificationResponse:response closure:nil]; +- (void) userNotificationCenter:(UNUserNotificationCenter *) center + didReceiveNotificationResponse:(UNNotificationResponse *) response + withCompletionHandler:(void (^)(void)) completionHandler { + + [AEPMobileMessaging handleNotificationResponse:response urlHandler: ^(NSURL *url) { + /// return `true` if the app is handling the url or `false` if the Adobe SDK should handle it + bool appHandlesUrl = false; + return appHandlesUrl; + } closure:^(AEPPushTrackingStatus status) { + if (status == AEPPushTrackingStatusTrackingInitiated) { + // tracking was successful + } else { + // tracking failed, view the status for more information + } + }]; } ``` @@ -85,17 +107,17 @@ Implement the callback in `handleNotificationResponse` API to read [PushTracking #### Swift ```swift - Messaging.handleNotificationResponse(response) { trackingStatus in - // handle the different values of trackingStatus - } +Messaging.handleNotificationResponse(response) { trackingStatus in + // handle the different values of trackingStatus +} ``` #### Objective-C ```objc - [AEPMobileMessaging handleNotificationResponse:response closure:^(AEPPushTrackingStatus status){ - if (status == AEPPushTrackingStatusTrackingInitiated) { - NSLog(@"Successfully started push notification tracking"); - } - }]; +[AEPMobileMessaging handleNotificationResponse:response urlHandler:nil closure:^(AEPPushTrackingStatus status) { + if (status == AEPPushTrackingStatusTrackingInitiated) { + NSLog(@"Successfully started push notification tracking"); + } +}]; ``` diff --git a/src/pages/edge/adobe-journey-optimizer/release-notes.md b/src/pages/edge/adobe-journey-optimizer/release-notes.md index b9591bad96..cf3788efd6 100644 --- a/src/pages/edge/adobe-journey-optimizer/release-notes.md +++ b/src/pages/edge/adobe-journey-optimizer/release-notes.md @@ -11,16 +11,16 @@ keywords: ## March 20, 2024 -Major version update for [Adobe Journey Optimizer](./index.md) for Adobe Experience Platform Mobile SDKs on iOS compatible with Mobile Core 5.0.0. The current release includes the following changes: +Major version update for [Adobe Journey Optimizer](../../edge/adobe-journey-optimizer/index.md) for Adobe Experience Platform Mobile SDKs on iOS compatible with Mobile Core 5.0.0. The current release includes the following changes: * Updated the minimum supported version to iOS 12.0. * Include XCFrameworks built with Xcode 15.0.1 with the GitHub release. -* Added `handleNotificationResponse(_:urlHandler:closure:)` API to provide more control over URL handling from `UNNotificationResponse` objects. +* Added [`handleNotificationResponse(_:urlHandler:closure:)`](./../../edge/adobe-journey-optimizer/api-reference/#handlenotificationresponse) API to provide more control over URL handling from `UNNotificationResponse` objects. * Removed deprecated public API `Messaging.handleNotificationResponse(_:applicationOpened:withCustomActionId:)`. * Removed public API `Messaging.handleNotificationResponse(_:closure:)` API. * Added support for [Code Based Experiences](https://experienceleague.adobe.com/en/docs/journey-optimizer/using/code-based-experience/get-started-code-based). - * Added public API `Messaging.updatePropositionsForSurfaces(_)`. - * Added public API `Messaging.getPropositionsForSurfaces(_:completion:)`. + * Added public API [`Messaging.updatePropositionsForSurfaces(_)`](./../../edge/adobe-journey-optimizer/code-based/api-reference/#updatepropositionsforsurfaces). + * Added public API [`Messaging.getPropositionsForSurfaces(_:completion:)`](./../../edge/adobe-journey-optimizer/code-based/api-reference/#getpropositionsforsurfaces). ## March 5, 2024 diff --git a/src/pages/edge/adobe-journey-optimizer/tabs/api-reference.md b/src/pages/edge/adobe-journey-optimizer/tabs/api-reference.md index 3235203f81..ef1717791d 100644 --- a/src/pages/edge/adobe-journey-optimizer/tabs/api-reference.md +++ b/src/pages/edge/adobe-journey-optimizer/tabs/api-reference.md @@ -74,8 +74,8 @@ public static void handleNotificationResponse(final Intent intent, ```swift static func handleNotificationResponse(_ response: UNNotificationResponse, - applicationOpened: Bool, - customActionId: String?) + urlHandler: ((URL) -> Bool)? = nil, + closure: ((PushTrackingStatus) -> Void)? = nil) ``` #### Objective-C @@ -83,16 +83,16 @@ static func handleNotificationResponse(_ response: UNNotificationResponse, **Syntax** ```objc -+ (void)handleNotificationResponse:(UNNotificationResponse *)response - applicationOpened: (BOOL)applicationOpened - customActionId: (NSString *)customActionId; ++ (void) handleNotificationResponse: (UNNotificationResponse *) response + urlHandler: (BOOL (^)(NSURL *url)) handler + closure: (void (^)(PushTrackingStatus status)) closure; ``` | **Parameter** | **Type** | **Description** | | :----------- | :------- | :-------------- | -| `response` | UNNotificationResponse | An object containing information about the push notification details. | -| `applicationOpened` | Boolean | Shows whether the application has been opened or not. | -| `customActionId` | String | The ID of the custom action. | +| `response` | `UNNotificationResponse` | An object containing information about the push notification details. | +| `urlHandler` | `((URL) -> Bool)?` | An optional method to handle the actionable URL from the push notification. | +| `closure` | `((PushTrackingStatus) -> Void)?` | An optional callback with `PushTrackingStatus` representing the tracking status of the interacted notification. | diff --git a/src/pages/home/release-notes/index.md b/src/pages/home/release-notes/index.md index 79126a1d3e..e25bf16759 100644 --- a/src/pages/home/release-notes/index.md +++ b/src/pages/home/release-notes/index.md @@ -66,12 +66,12 @@ Major version update for [Adobe Journey Optimizer](../../edge/adobe-journey-opti * Updated the minimum supported version to iOS 12.0. * Include XCFrameworks built with Xcode 15.0.1 with the GitHub release. -* Added `handleNotificationResponse(_:urlHandler:closure:)` API to provide more control over URL handling from `UNNotificationResponse` objects. +* Added [`handleNotificationResponse(_:urlHandler:closure:)`](./../../edge/adobe-journey-optimizer/api-reference/#handlenotificationresponse) API to provide more control over URL handling from `UNNotificationResponse` objects. * Removed deprecated public API `Messaging.handleNotificationResponse(_:applicationOpened:withCustomActionId:)`. * Removed public API `Messaging.handleNotificationResponse(_:closure:)` API. * Added support for [Code Based Experiences](https://experienceleague.adobe.com/en/docs/journey-optimizer/using/code-based-experience/get-started-code-based). - * Added public API `Messaging.updatePropositionsForSurfaces(_)`. - * Added public API `Messaging.getPropositionsForSurfaces(_:completion:)`. + * Added public API [`Messaging.updatePropositionsForSurfaces(_)`](./../../edge/adobe-journey-optimizer/code-based/api-reference/#updatepropositionsforsurfaces). + * Added public API [`Messaging.getPropositionsForSurfaces(_:completion:)`](./../../edge/adobe-journey-optimizer/code-based/api-reference/#getpropositionsforsurfaces). ### iOS Optimize 5.0.0 diff --git a/src/pages/resources/migration/ios/migrate-to-5x.md b/src/pages/resources/migration/ios/migrate-to-5x.md index 91a4ced900..1e62880893 100644 --- a/src/pages/resources/migration/ios/migrate-to-5x.md +++ b/src/pages/resources/migration/ios/migrate-to-5x.md @@ -143,10 +143,19 @@ MobileCore.track(state: "view name", data: ["&&events": "event5,event2=2"]) } ``` -#### Messaging +### Messaging -Change usages of `Messaging.handleNotificationResponse(_:applicationOpened:withCustomActionId:)` and `Messaging.handleNotificationResponse(_:closure:)` to `Messaging.handleNotificationResponse(_:urlHandler:closure:)` +#### Push tracking + +In order to provide more control over URL handling from `UNNotificationResponse` objects, two old APIs were removed and a new one was added. + +| Old API (4.x) | New API (5.x) | +| ------------- | ------------- | +| `handleNotificationResponse(_:applicationOpened:withCustomActionId:)` | `handleNotificationResponse(_:urlHandler:closure:)` | +| `handleNotificationResponse(_:closure:)` | `handleNotificationResponse(_:urlHandler:closure:)` | + +For examples see [handleNotificationResponse](./../../../edge/adobe-journey-optimizer/api-reference#handlenotificationresponse). #### Optimize -Change all references from class `Proposition` to `OptimizeProposition`. +The `Proposition` class has been renamed to [`OptimizeProposition`](./../../../edge/adobe-journey-optimizer-decisioning/api-reference/#propositionoptimizeproposition). All references should be updated accordingly. From c7e52aefdfdd0cddcbf25cdc1c01e6434119633d Mon Sep 17 00:00:00 2001 From: Steve Benedick Date: Fri, 22 Mar 2024 14:02:46 -0600 Subject: [PATCH 6/8] -optimize updates --- .../api-reference.md | 4 +-- .../index.md | 2 +- .../tabs/api-reference.md | 28 +++++++++---------- .../tabs/index.md | 8 +++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/pages/edge/adobe-journey-optimizer-decisioning/api-reference.md b/src/pages/edge/adobe-journey-optimizer-decisioning/api-reference.md index 2fe18f4154..b5576994a4 100644 --- a/src/pages/edge/adobe-journey-optimizer-decisioning/api-reference.md +++ b/src/pages/edge/adobe-journey-optimizer-decisioning/api-reference.md @@ -103,10 +103,10 @@ iOS ## Public classes -| Type | Android | (AEP 3.x) Swift | (AEP 3.x) Objective-C | +| Type | Android | (AEP 5.x) Swift | (AEP 5.x) Objective-C | | :--- | :--- | :--- | :--- | | class | `DecisionScope` | `DecisionScope` | `AEPDecisionScope` | -| class | `Proposition` | `Proposition` | `AEPProposition` | +| class | `Proposition` | `OptimizeProposition` | `AEPOptimizeProposition` | | class | `Offer` | `Offer` | `AEPOffer` | ### DecisionScope diff --git a/src/pages/edge/adobe-journey-optimizer-decisioning/index.md b/src/pages/edge/adobe-journey-optimizer-decisioning/index.md index 46479e4bd4..be6a2f4aae 100644 --- a/src/pages/edge/adobe-journey-optimizer-decisioning/index.md +++ b/src/pages/edge/adobe-journey-optimizer-decisioning/index.md @@ -271,7 +271,7 @@ iOS ### Proposition tracking using Edge extension API -For more advanced tracking use cases, additional public methods are available in the `Offer` and `Proposition` classes. These methods can be used to generate XDM formatted data for `Experience Event - Proposition Interactions` and `Experience Event - Proposition Reference` field groups. +For more advanced tracking use cases, additional public methods are available in the `Offer` and `Proposition`/`OptimizeProposition` classes. These methods can be used to generate XDM formatted data for `Experience Event - Proposition Interactions` and `Experience Event - Proposition Reference` field groups. diff --git a/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/api-reference.md b/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/api-reference.md index 7bc82b7f7f..3328b38262 100644 --- a/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/api-reference.md +++ b/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/api-reference.md @@ -148,11 +148,11 @@ Optimize.getPropositions(scopes, new AdobeCallbackWithError Void) + _ completion: @escaping ([DecisionScope: OptimizeProposition]?, Error?) -> Void) ``` * _decisionScopes_ is an array of decision scopes for which propositions are requested. -* _completion_ is invoked with propositions dictionary of type `[DecisionScope: Proposition]`. An `Error` is returned if SDK fails to retrieve the propositions. +* _completion_ is invoked with propositions dictionary of type `[DecisionScope: OptimizeProposition]`. An `Error` is returned if SDK fails to retrieve the propositions. #### Example @@ -189,11 +189,11 @@ Optimize.getPropositions(for: [decisionScope1, decisionScope2]) { propositionsDi ```objc + (void) getPropositions: (NSArray* _Nonnull) decisionScopes - completion: (void (^ _Nonnull)(NSDictionary* _Nullable propositionsDict, NSError* _Nullable error)) completion; + completion: (void (^ _Nonnull)(NSDictionary* _Nullable propositionsDict, NSError* _Nullable error)) completion; ``` * _decisionScopes_ is an array of decision scopes for which propositions are requested. -* _completion_ is invoked with propositions dictionary of type `NSDictionary`. An `NSError` is returned if SDK fails to retrieve the propositions. +* _completion_ is invoked with propositions dictionary of type `NSDictionary`. An `NSError` is returned if SDK fails to retrieve the propositions. #### Example @@ -204,16 +204,16 @@ AEPDecisionScope* decisionScope1 = [[AEPDecisionScope alloc] initWithActivityId: AEPDecisionScope* decisionScope2 = [[AEPDecisionScope alloc] initWithName: @"myScope"]; [AEPMobileOptimize getPropositions: @[decisionScope1, decisionScope2] - completion: ^(NSDictionary* propositionsDict, NSError* error) { + completion: ^(NSDictionary* propositionsDict, NSError* error) { if (error != nil) { // handle error return; } - AEPProposition* proposition1 = propositionsDict[decisionScope1]; + AEPOptimizeProposition* proposition1 = propositionsDict[decisionScope1]; // read proposition1 offers - AEPProposition* proposition2 = propositionsDict[decisionScope2]; + AEPOptimizeProposition* proposition2 = propositionsDict[decisionScope2]; // read proposition2 offers }]; ``` @@ -255,10 +255,10 @@ Optimize.onPropositionsUpdate(new AdobeCallbackWithError Void) +static func onPropositionsUpdate(perform action: @escaping ([DecisionScope: OptimizeProposition]?) -> Void) ``` -* _action_ is invoked with propositions dictionary of type `[DecisionScope: Proposition]`. +* _action_ is invoked with propositions dictionary of type `[DecisionScope: OptimizeProposition]`. #### Example @@ -275,15 +275,15 @@ Optimize.onPropositionsUpdate { propositionsDict in #### Syntax ```objc -+ (void) onPropositionsUpdate: (void (^ _Nonnull)(NSDictionary* _Nullable)) action; ++ (void) onPropositionsUpdate: (void (^ _Nonnull)(NSDictionary* _Nullable)) action; ``` -* _action_ is invoked with propositions dictionary of type `NSDictionary`. +* _action_ is invoked with propositions dictionary of type `NSDictionary`. #### Example ```objc -[AEPMobileOptimize onPropositionsUpdate: ^(NSDictionary* propositionsDict) { +[AEPMobileOptimize onPropositionsUpdate: ^(NSDictionary* propositionsDict) { // handle propositions }]; ``` @@ -816,7 +816,7 @@ public extension Offer { /// If the proposition reference within the option is released and no longer valid, the method returns `nil`. /// /// - Note: The returned XDM data also contains the `eventType` for the Experience Event with value `decisioning.propositionDisplay`. - /// - Returns A dictionary containing XDM data for the propositon interactions. + /// - Returns A dictionary containing XDM data for the proposition interactions. func generateDisplayInteractionXdm() -> [String: Any]? {...} /// Creates a dictionary containing XDM formatted data for `Experience Event - Proposition Interactions` field group from the given proposition option. @@ -825,7 +825,7 @@ public extension Offer { /// If the proposition reference within the option is released and no longer valid, the method returns `nil`. /// /// - Note: The returned XDM data also contains the `eventType` for the Experience Event with value `decisioning.propositionInteract`. - /// - Returns A dictionary containing XDM data for the propositon interactions. + /// - Returns A dictionary containing XDM data for the proposition interactions. func generateTapInteractionXdm() -> [String: Any]? {...} /// Dispatches an event for the Edge extension to send an Experience Event to the Edge network with the display interaction data for the given proposition item. diff --git a/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/index.md b/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/index.md index eb33c4c48c..37d0ba45c8 100644 --- a/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/index.md +++ b/src/pages/edge/adobe-journey-optimizer-decisioning/tabs/index.md @@ -457,7 +457,7 @@ public extension Offer { /// The Edge `sendEvent(experienceEvent:_:)` API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, or override dataset identifier. /// /// - Note: The returned XDM data also contains the `eventType` for the Experience Event with value `decisioning.propositionDisplay`. - /// - Returns A dictionary containing XDM data for the propositon interactions. + /// - Returns A dictionary containing XDM data for the proposition interactions. func generateDisplayInteractionXdm() -> [String: Any] {...} /// Creates a dictionary containing XDM formatted data for `Experience Event - Proposition Interactions` field group from the given proposition option. @@ -465,19 +465,19 @@ public extension Offer { /// The Edge `sendEvent(experienceEvent:_:)` API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, or override dataset identifier. /// /// - Note: The returned XDM data also contains the `eventType` for the Experience Event with value `decisioning.propositionInteract`. - /// - Returns A dictionary containing XDM data for the propositon interactions. + /// - Returns A dictionary containing XDM data for the proposition interactions. func generateTapInteractionXdm() -> [String: Any] {...} } ``` ```swift -public extension Proposition { +public extension OptimizeProposition { /// Creates a dictionary containing XDM formatted data for `Experience Event - Proposition Reference` field group from the given proposition. /// /// The Edge `sendEvent(experienceEvent:_:)` API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, or override dataset identifier. /// /// - Note: The returned XDM data does not contain an `eventType` for the Experience Event. - /// - Returns A dictionary containing XDM data for the propositon reference. + /// - Returns A dictionary containing XDM data for the proposition reference. func generateReferenceXdm() -> [String: Any] {...} } ``` From d4c19f30a06b9267002a09617598e6ec8c8cfce3 Mon Sep 17 00:00:00 2001 From: Steve Benedick Date: Fri, 22 Mar 2024 14:16:18 -0600 Subject: [PATCH 7/8] -fixing lint errors --- .../edge/adobe-journey-optimizer/code-based/api-reference.md | 1 - src/pages/edge/adobe-journey-optimizer/code-based/index.md | 2 +- .../adobe-journey-optimizer/code-based/tabs/api-reference.md | 2 +- src/pages/edge/adobe-journey-optimizer/index.md | 2 +- .../edge/adobe-journey-optimizer/public-classes/proposition.md | 1 - .../public-classes/tabs/proposition-item.md | 2 +- .../adobe-journey-optimizer/public-classes/tabs/proposition.md | 3 ++- .../adobe-journey-optimizer/public-classes/tabs/surface.md | 2 +- 8 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pages/edge/adobe-journey-optimizer/code-based/api-reference.md b/src/pages/edge/adobe-journey-optimizer/code-based/api-reference.md index 7017aee394..a67ad2a49a 100644 --- a/src/pages/edge/adobe-journey-optimizer/code-based/api-reference.md +++ b/src/pages/edge/adobe-journey-optimizer/code-based/api-reference.md @@ -45,4 +45,3 @@ Android iOS - diff --git a/src/pages/edge/adobe-journey-optimizer/code-based/index.md b/src/pages/edge/adobe-journey-optimizer/code-based/index.md index 6759ce7076..d59cc56296 100644 --- a/src/pages/edge/adobe-journey-optimizer/code-based/index.md +++ b/src/pages/edge/adobe-journey-optimizer/code-based/index.md @@ -20,4 +20,4 @@ This document guides you to integrating code-based experiences in your applicati * [Class - Proposition](../public-classes/proposition.md) * [Class - PropositionItem](../public-classes/proposition-item.md) * [Enum - MessagingEdgeEventType](../public-classes/messaging-edge-event-type.md) -* [Class - Surface](../public-classes/surface.md) \ No newline at end of file +* [Class - Surface](../public-classes/surface.md) diff --git a/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md b/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md index 77a12ea468..0f9fd8b36a 100644 --- a/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md +++ b/src/pages/edge/adobe-journey-optimizer/code-based/tabs/api-reference.md @@ -197,4 +197,4 @@ AEPSurface* surface1 = [[AEPSurface alloc] initWithPath: @"myView#button"]; AEPSurface* surface2 = [[AEPSurface alloc] initWithPath: @"myView#button"]; [AEPMobileMessaging updatePropositionsForSurfaces: @[surface1, surface2]]; -``` \ No newline at end of file +``` diff --git a/src/pages/edge/adobe-journey-optimizer/index.md b/src/pages/edge/adobe-journey-optimizer/index.md index c00ce3b639..800eb4452c 100644 --- a/src/pages/edge/adobe-journey-optimizer/index.md +++ b/src/pages/edge/adobe-journey-optimizer/index.md @@ -100,4 +100,4 @@ You can update the SDK configuration, including the Messaging configuration valu * [Push notification implementation guide](./push-notification/index.md) * [In-App message implementation guide](./in-app-message/index.md) -* [Code-based experiences implementation guide](./code-based/index.md) \ No newline at end of file +* [Code-based experiences implementation guide](./code-based/index.md) diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md index 9906eb4be8..66ce4a477c 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/proposition.md @@ -83,4 +83,3 @@ Android --> - diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md index e243d549e1..e765d34f99 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition-item.md @@ -140,4 +140,4 @@ public void track(final String interaction, @NonNull final MessagingEdgeEventTyp * _interaction_ is a custom string value describing the interaction. * _eventType_ is an enum specifying event type for the interaction. -* _tokens_ is a list containing the decision item tokens for recording interaction. \ No newline at end of file +* _tokens_ is a list containing the decision item tokens for recording interaction. diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md index 9db68e3c1b..2bc3c29b17 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/proposition.md @@ -21,6 +21,7 @@ public List getItems() ```java public String getScope() ``` + #### Java @@ -29,4 +30,4 @@ public String getScope() ```java public String getUniqueId() -``` \ No newline at end of file +``` diff --git a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md index 0c2df10bb3..883db6dc32 100644 --- a/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md +++ b/src/pages/edge/adobe-journey-optimizer/public-classes/tabs/surface.md @@ -72,4 +72,4 @@ public String getUri() ```java final Surface surface = new Surface("homeActivity#banner") final String uri = surface.getUri() -``` \ No newline at end of file +``` From 85badf2d25fd6b11032227265e5b779620df2d41 Mon Sep 17 00:00:00 2001 From: Steve Benedick Date: Fri, 22 Mar 2024 15:15:38 -0600 Subject: [PATCH 8/8] -simplify paths in some doc links --- src/pages/edge/adobe-journey-optimizer/release-notes.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/edge/adobe-journey-optimizer/release-notes.md b/src/pages/edge/adobe-journey-optimizer/release-notes.md index cf3788efd6..dac5519ba8 100644 --- a/src/pages/edge/adobe-journey-optimizer/release-notes.md +++ b/src/pages/edge/adobe-journey-optimizer/release-notes.md @@ -11,16 +11,16 @@ keywords: ## March 20, 2024 -Major version update for [Adobe Journey Optimizer](../../edge/adobe-journey-optimizer/index.md) for Adobe Experience Platform Mobile SDKs on iOS compatible with Mobile Core 5.0.0. The current release includes the following changes: +Major version update for [Adobe Journey Optimizer](./index.md) for Adobe Experience Platform Mobile SDKs on iOS compatible with Mobile Core 5.0.0. The current release includes the following changes: * Updated the minimum supported version to iOS 12.0. * Include XCFrameworks built with Xcode 15.0.1 with the GitHub release. -* Added [`handleNotificationResponse(_:urlHandler:closure:)`](./../../edge/adobe-journey-optimizer/api-reference/#handlenotificationresponse) API to provide more control over URL handling from `UNNotificationResponse` objects. +* Added [`handleNotificationResponse(_:urlHandler:closure:)`](./api-reference/#handlenotificationresponse) API to provide more control over URL handling from `UNNotificationResponse` objects. * Removed deprecated public API `Messaging.handleNotificationResponse(_:applicationOpened:withCustomActionId:)`. * Removed public API `Messaging.handleNotificationResponse(_:closure:)` API. * Added support for [Code Based Experiences](https://experienceleague.adobe.com/en/docs/journey-optimizer/using/code-based-experience/get-started-code-based). - * Added public API [`Messaging.updatePropositionsForSurfaces(_)`](./../../edge/adobe-journey-optimizer/code-based/api-reference/#updatepropositionsforsurfaces). - * Added public API [`Messaging.getPropositionsForSurfaces(_:completion:)`](./../../edge/adobe-journey-optimizer/code-based/api-reference/#getpropositionsforsurfaces). + * Added public API [`Messaging.updatePropositionsForSurfaces(_)`](./code-based/api-reference/#updatepropositionsforsurfaces). + * Added public API [`Messaging.getPropositionsForSurfaces(_:completion:)`](./code-based/api-reference/#getpropositionsforsurfaces). ## March 5, 2024