Skip to content

Commit

Permalink
PR comments resolved
Browse files Browse the repository at this point in the history
Addressing the PR comments

PR comment resolved

PR comments resolved
  • Loading branch information
siddique-adobe committed Nov 27, 2024
1 parent 7159bad commit 809e0ac
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ iOS

<Tabs query="platform=ios&api=update-propositions-withCallback"/>

## updatePropositionsWithCompletionHandlerWithCompletionTimeout
## updatePropositionsWithCompletionHandlerAndTimeout

This API dispatches an event for the Edge network extension to fetch decision propositions for the provided decision scopes array from the decisioning services enabled in the Experience Edge. Similar to `updatePropositionsWithCompletionHandler`, the returned decision propositions are cached in-memory within the Optimize SDK extension and can be retrieved using the `getPropositions` API.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public static void getPropositions(final List<DecisionScope> decisionScopes, fin
```

* _decisionScopes_ is a list of decision scopes for which propositions are requested.
* _timeoutMillis_ is a duration in milliseconds specifying the maximum time to wait for the event to complete.
* _timeoutMillis_ is a duration in milliseconds specifying the maximum time `getProposition` will wait for completion before returning [AdobeError.CALLBACK_TIMEOUT](../../home/base/mobile-core/api-reference.md#adobeerror).
* _callback_ `call` method is invoked with propositions map of type `Map<DecisionScope, OptimizeProposition>`. 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
Expand Down Expand Up @@ -272,19 +272,20 @@ AEPDecisionScope* decisionScope2 = [[AEPDecisionScope alloc] initWithName: @"myS
#### Syntax
```swift
static func getPropositions(for decisionScopes: [DecisionScope], timeout: TimeInterval,
static func getPropositions(for decisionScopes: [DecisionScope],
timeout: TimeInterval,
_ completion: @escaping ([DecisionScope: OptimizeProposition]?, Error?) -> Void)
```

* _decisionScopes_ is an array of decision scopes for which propositions are requested.
* _timeout_ is a duration in seconds specifying the maximum time to wait for the event to complete.
* _timeout_ is a duration in milliseconds specifying the maximum time `getProposition` will wait for completion before returning [AdobeError.CALLBACK_TIMEOUT](../../home/base/mobile-core/api-reference.md#adobeerror).
* _completion_ is invoked with propositions dictionary of type `[DecisionScope: OptimizeProposition]`. An `Error` is returned if SDK fails to retrieve the propositions.

#### Example

```swift
let decisionScope1 = DecisionScope(activityId: "xcore:offer-activity:1111111111111111",
placementId: "xcore:offer-placement:1111111111111111"
placementId: "xcore:offer-placement:1111111111111111",
itemCount: 2)
let decisionScope2 = DecisionScope(name: "myScope")

Expand Down Expand Up @@ -442,7 +443,7 @@ public static void updatePropositions(final List<DecisionScope> decisionScopes,
```

* _decisionScopes_ is a list of decision scopes for which propositions need updating.
* _xdm_ is a map containing additional xdm formatted data to be attached to the Experience Event.
* _xdm_ is a map containing additional XDM formatted data to be attached to the Experience Event.
* _data_ is a map containing additional freeform data to be attached to the Experience Event.

#### Example
Expand Down Expand Up @@ -482,9 +483,9 @@ public static void updatePropositions(final List<DecisionScope> decisionScopes,
```

* _decisionScopes_ is a list of decision scopes for which propositions need updating.
* _xdm_ is a map containing additional xdm formatted data to be attached to the Experience Event.
* _xdm_ is a map containing additional XDM formatted data to be attached to the Experience Event.
* _data_ is a map containing additional freeform data to be attached to the Experience Event.
* _callback_ is an optional completion handler that is invoked at the completion of the edge request. `call` method is invoked with propositions map of type `Map<DecisionScope, OptimizeProposition>`. If the callback is an instance of `AdobeCallbackWithOptimizeError`, and if the operation times out or an error occurs in retrieving propositions, the `fail` method is invoked with the appropriate [AEPOptimizeError](../api-reference.md#aepoptimizeerror). _Note:_ In certain cases, both the success and failure callbacks may be triggered. To handle these cases, ensure that your implementation checks for both successful propositions and errors within the callback, as both may be present simultaneously.
* _callback_ is an optional completion handler that is invoked at the completion of the edge request. The `call` method is invoked with propositions map of type `Map<DecisionScope, OptimizeProposition>`. If the callback is an instance of `AdobeCallbackWithOptimizeError`, and if the operation times out or an error occurs in retrieving propositions, the `fail` method is invoked with the appropriate [AEPOptimizeError](../api-reference.md#aepoptimizeerror). _Note:_ In certain cases, both the success and failure callbacks may be triggered. To handle these cases, ensure that your implementation checks for both successful propositions and errors within the callback, as both may be present simultaneously.

#### Example

Expand Down Expand Up @@ -535,10 +536,10 @@ public static void updatePropositions(final List<DecisionScope> decisionScopes,
```

* _decisionScopes_ is a list of decision scopes for which propositions need updating.
* _xdm_ is a map containing additional xdm formatted data to be attached to the Experience Event.
* _xdm_ is a map containing additional XDM formatted data to be attached to the Experience Event.
* _data_ is a map containing additional freeform data to be attached to the Experience Event.
* _timeoutMillis_ is a duration in milliseconds specifying the maximum time to wait for the event to complete.
* _callback_ is an optional completion handler that is invoked at the completion of the edge request. `call` method is invoked with propositions map of type `Map<DecisionScope, OptimizeProposition>`. If the callback is an instance of `AdobeCallbackWithOptimizeError`, and if the operation times out or an error occurs in retrieving propositions, the `fail` method is invoked with the appropriate [AEPOptimizeError](../api-reference.md#aepoptimizeerror). _Note:_ In certain cases, both the success and failure callbacks may be triggered. To handle these cases, ensure that your implementation checks for both successful propositions and errors within the callback, as both may be present simultaneously.
* _timeoutMillis_ is a duration in milliseconds specifying the maximum time `updateProposition` will wait for completion before returning [AdobeError.CALLBACK_TIMEOUT](../../home/base/mobile-core/api-reference.md#adobeerror).
* _callback_ is an optional completion handler that is invoked at the completion of the edge request. The `call` method is invoked with propositions map of type `Map<DecisionScope, OptimizeProposition>`. If the callback is an instance of `AdobeCallbackWithOptimizeError`, and if the operation times out or an error occurs in retrieving propositions, the `fail` method is invoked with the appropriate [AEPOptimizeError](../api-reference.md#aepoptimizeerror). _Note:_ In certain cases, both the success and failure callbacks may be triggered. To handle these cases, ensure that your implementation checks for both successful propositions and errors within the callback, as both may be present simultaneously.

#### Example

Expand Down Expand Up @@ -588,7 +589,7 @@ static func updatePropositions(for decisionScopes: [DecisionScope],
```

* _decisionScopes_ is an array of decision scopes for which propositions need updating.
* _xdm_ is a dictionary containing additional xdm formatted data to be attached to the Experience Event.
* _xdm_ is a dictionary containing additional XDM formatted data to be attached to the Experience Event.
* _data_ is a dictionary containing additional freeform data to be attached to the Experience Event.

#### Example
Expand All @@ -615,7 +616,7 @@ Optimize.updatePropositions(for: [decisionScope1, decisionScope2]
```

* _decisionScopes_ is an array of decision scopes for which propositions need updating.
* _xdm_ is a dictionary containing additional xdm formatted data to be attached to the Experience Event.
* _xdm_ is a dictionary containing additional XDM formatted data to be attached to the Experience Event.
* _data_ is a dictionary containing additional freeform data to be attached to the Experience Event.

#### Example
Expand Down Expand Up @@ -645,7 +646,7 @@ static func updatePropositions(for decisionScopes: [DecisionScope],
```

* _decisionScopes_ is an array of decision scopes for which propositions need updating.
* _xdm_ is a dictionary containing additional xdm formatted data to be attached to the Experience Event.
* _xdm_ is a dictionary containing additional XDM formatted data to be attached to the Experience Event.
* _data_ is a dictionary containing additional freeform data to be attached to the Experience Event.
* _completion_ is a optional completion handler invoked at the completion of the edge request with map of successful decision scopes to propositions and errors, if any.

Expand Down Expand Up @@ -678,7 +679,7 @@ Optimize.updatePropositions(for: [decisionScope1, decisionScope2]
```

* _decisionScopes_ is an array of decision scopes for which propositions are requested.
* _xdm_ is a dictionary containing additional xdm formatted data to be attached to the Experience Event.
* _xdm_ is a dictionary containing additional XDM formatted data to be attached to the Experience Event.
* _data_ is a dictionary containing additional freeform data to be attached to the Experience Event.
* _completion_ is invoked with propositions dictionary of type `NSDictionary<AEPDecisionScope*, AEPOptimizeProposition*>`. An `NSError` is returned if SDK fails to retrieve the propositions.

Expand Down Expand Up @@ -723,7 +724,7 @@ static func updatePropositions(for decisionScopes: [DecisionScope],
```

* _decisionScopes_ is an array of decision scopes for which propositions need updating.
* _xdm_ is a dictionary containing additional xdm formatted data to be attached to the Experience Event.
* _xdm_ is a dictionary containing additional XDM formatted data to be attached to the Experience Event.
* _data_ is a dictionary containing additional freeform data to be attached to the Experience Event.
* _timeout_ is a duration in seconds specifying the maximum time to wait for the event to complete.
* _completion_ is a optional completion handler invoked at the completion of the edge request with map of successful decision scopes to propositions and errors, if any.
Expand All @@ -732,12 +733,12 @@ static func updatePropositions(for decisionScopes: [DecisionScope],

```swift
let decisionScope1 = DecisionScope(activityId: "xcore:offer-activity:1111111111111111",
placementId: "xcore:offer-placement:1111111111111111"
placementId: "xcore:offer-placement:1111111111111111",
itemCount: 2)
let decisionScope2 = DecisionScope(name: "myScope")

Optimize.updatePropositions(for: [decisionScope1, decisionScope2]
withXdm: ["xdmKey": "xdmValue"]
Optimize.updatePropositions(for: [decisionScope1, decisionScope2],
withXdm: ["xdmKey": "xdmValue"],
andData: ["dataKey": "dataValue"],
timeout: 1.0) { data, error in
if let error = error as? AEPOptimizeError {
Expand All @@ -759,7 +760,7 @@ Optimize.updatePropositions(for: [decisionScope1, decisionScope2]
```

* _decisionScopes_ is an array of decision scopes for which propositions are requested.
* _xdm_ is a dictionary containing additional xdm formatted data to be attached to the Experience Event.
* _xdm_ is a dictionary containing additional XDM formatted data to be attached to the Experience Event.
* _data_ is a dictionary containing additional freeform data to be attached to the Experience Event.
* _timeout_ is a duration in seconds specifying the maximum time to wait for the event to complete.
* _completion_ is invoked with propositions dictionary of type `NSDictionary<AEPDecisionScope*, AEPOptimizeProposition*>`. An `NSError` is returned if SDK fails to retrieve the propositions.
Expand Down

0 comments on commit 809e0ac

Please sign in to comment.